﻿using Nett;
using System;
using System.Collections.Generic;
using System.IO;

namespace M2Server
{
    public class ServerConfig
    {
        private readonly TomlTable _tableConfig;
        private readonly string _fileName = "config.toml";

        public ServerConfig()
        {
            if (!File.Exists(_fileName))
            {
                Console.WriteLine("配置文件config.toml不存在.");
                return;
            }
            var input = new StreamReader(_fileName);
            _tableConfig = Toml.ReadString(input.ReadToEnd());
        }

        /// <summary>
        /// 加载配置文件
        /// </summary>
        public void Load()
        {
            M2Share.g_Config.sServerName = GetConfig<string>("Server", "ServerName", M2Share.g_Config.sServerName);
            M2Share.nServerIndex = GetConfig<int>("Server", "ServerIndex", M2Share.nServerIndex);
            M2Share.g_Config.sServerIPaddr = GetConfig<string>("Server", "ServerIP", M2Share.g_Config.sServerIPaddr);
            M2Share.g_Config.nServerNumber = GetConfig<ushort>("Server", "ServerNumber", M2Share.g_Config.nServerNumber);
            M2Share.g_Config.boVentureServer = (GetConfig<string>("Server", "VentureServer", "FALSE")).ToLower().CompareTo(("TRUE").ToLower()) == 0;
            M2Share.g_Config.boTestServer = (GetConfig<string>("Server", "TestServer", "FALSE")).ToLower().CompareTo(("TRUE").ToLower()) == 0;
            M2Share.g_Config.nTestLevel = GetConfig<ushort>("Server", "TestLevel", M2Share.g_Config.nTestLevel);
            M2Share.g_Config.nTestGold = GetConfig<int>("Server", "TestGold", M2Share.g_Config.nTestGold);
            M2Share.g_Config.nTestUserLimit = GetConfig<ushort>("Server", "TestServerUserLimit", M2Share.g_Config.nTestUserLimit);
            M2Share.g_Config.boServiceMode =GetConfig<bool>("Server","ServiceMode", M2Share.g_Config.boServiceMode);
            M2Share.g_Config.boNonPKServer =GetConfig<bool>("Server","NonPKServer", M2Share.g_Config.boNonPKServer);
            M2Share.g_Config.boViewHackMessage =GetConfig<bool>("Server","ViewHackMessage", M2Share.g_Config.boViewHackMessage);
            M2Share.g_Config.boViewAdmissionFailure =GetConfig<bool>("Server","ViewAdmissionFailure", M2Share.g_Config.boViewAdmissionFailure);
            M2Share.g_Config.sGateAddr = GetConfig<string>("Server", "GateAddr", M2Share.g_Config.sGateAddr);
            M2Share.g_Config.nGatePort = GetConfig<ushort>("Server", "GatePort", M2Share.g_Config.nGatePort);
            M2Share.g_Config.sDBAddr = GetConfig<string>("Server", "DBAddr", M2Share.g_Config.sDBAddr);
            M2Share.g_Config.nDBPort = GetConfig<ushort>("Server", "DBPort", M2Share.g_Config.nDBPort);
            M2Share.g_Config.sIDSAddr = GetConfig<string>("Server", "IDSAddr", M2Share.g_Config.sIDSAddr);
            M2Share.g_Config.nIDSPort = GetConfig<ushort>("Server", "IDSPort", M2Share.g_Config.nIDSPort);
            M2Share.g_Config.sMsgSrvAddr = GetConfig<string>("Server", "MsgSrvAddr", M2Share.g_Config.sMsgSrvAddr);
            M2Share.g_Config.nMsgSrvPort = GetConfig<ushort>("Server", "MsgSrvPort", M2Share.g_Config.nMsgSrvPort);
            M2Share.g_Config.sLogServerAddr = GetConfig<string>("Server", "LogServerAddr", M2Share.g_Config.sLogServerAddr);
            M2Share.g_Config.nLogServerPort = GetConfig<ushort>("Server", "LogServerPort", M2Share.g_Config.nLogServerPort);
            M2Share.g_Config.boDiscountForNightTime =GetConfig<bool>("Server","DiscountForNightTime", false);
            M2Share.g_Config.nHalfFeeStart = GetConfig<int>("Server", "HalfFeeStart", M2Share.g_Config.nHalfFeeStart);
            M2Share.g_Config.nHalfFeeEnd = GetConfig<int>("Server", "HalfFeeEnd", M2Share.g_Config.nHalfFeeEnd);
            M2Share.g_dwHumLimit = GetConfig<int>("Server", "HumLimit", M2Share.g_dwHumLimit);
            M2Share.g_dwMonLimit = GetConfig<int>("Server", "MonLimit", M2Share.g_dwMonLimit);
            M2Share.g_dwZenLimit = GetConfig<int>("Server", "ZenLimit", M2Share.g_dwZenLimit);
            M2Share.g_dwNpcLimit = GetConfig<int>("Server", "NpcLimit", M2Share.g_dwNpcLimit);
            M2Share.g_dwSocLimit = GetConfig<int>("Server", "SocLimit", M2Share.g_dwSocLimit);
            M2Share.nDecLimit = GetConfig<int>("Server", "DecLimit", M2Share.nDecLimit);
            M2Share.g_Config.nSendBlock = GetConfig<int>("Server", "SendBlock", M2Share.g_Config.nSendBlock);
            M2Share.g_Config.nCheckBlock = GetConfig<int>("Server", "CheckBlock", M2Share.g_Config.nCheckBlock);
            M2Share.g_dwSocCheckTimeOut = GetConfig<uint>("Server","SocCheckTimeOut", M2Share.g_dwSocCheckTimeOut);
            M2Share.g_Config.nAvailableBlock = GetConfig<int>("Server", "AvailableBlock", M2Share.g_Config.nAvailableBlock);
            M2Share.g_Config.nGateLoad = GetConfig<int>("Server", "GateLoad", M2Share.g_Config.nGateLoad);
            M2Share.g_Config.nUserFull = GetConfig<int>("Server", "UserFull", M2Share.g_Config.nUserFull);
            M2Share.g_Config.nZenFastStep = GetConfig<int>("Server", "ZenFastStep", M2Share.g_Config.nZenFastStep);
            M2Share.g_Config.dwProcessMonstersTime = GetConfig<uint>("Server","ProcessMonstersTime", M2Share.g_Config.dwProcessMonstersTime);
            M2Share.g_Config.dwRegenMonstersTime = GetConfig<uint>("Server","RegenMonstersTime", M2Share.g_Config.dwRegenMonstersTime);
            M2Share.g_Config.dwHumanGetMsgTime = GetConfig<uint>("Server","HumanGetMsgTimeLimit", M2Share.g_Config.dwHumanGetMsgTime);

            M2Share.g_Config.sBaseDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share","BaseDir", M2Share.g_Config.sBaseDir));
            M2Share.g_Config.sGuildDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share","GuildDir", M2Share.g_Config.sGuildDir));
            M2Share.g_Config.sGuildFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share","GuildFile", M2Share.g_Config.sGuildFile));
            M2Share.g_Config.sVentureDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share","VentureDir", M2Share.g_Config.sVentureDir));
            M2Share.g_Config.sConLogDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share","ConLogDir", M2Share.g_Config.sConLogDir));
            M2Share.g_Config.sCastleDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share","CastleDir", M2Share.g_Config.sCastleDir));// 沙巴克文件
            M2Share.g_Config.sCastleFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share","CastleFile", M2Share.g_Config.sCastleFile));
            M2Share.g_Config.sSortDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share","SortDir", M2Share.g_Config.sSortDir));// 排行榜路径 20080220
            M2Share.g_Config.sBoxsDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share","BoxsDir", M2Share.g_Config.sBoxsDir)); // 宝箱路径,文件 20080114
            M2Share.g_Config.sBoxsFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share","BoxsFile", M2Share.g_Config.sBoxsFile));

            M2Share.g_Config.sEnvirDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share", "EnvirDir", M2Share.g_Config.sEnvirDir));
            M2Share.g_Config.sMapDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share","MapDir", M2Share.g_Config.sMapDir));
            M2Share.g_Config.sNoticeDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share","NoticeDir", M2Share.g_Config.sNoticeDir));
            M2Share.g_Config.sLogDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share","LogDir", M2Share.g_Config.sLogDir));
            M2Share.g_Config.sPlugDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetConfig<string>("Share","PlugDir", M2Share.g_Config.sPlugDir));

            M2Share.g_Config.sHealSkill = GetConfig<string>("Names", "HealSkill", M2Share.g_Config.sHealSkill);
            M2Share.g_Config.sFireBallSkill = GetConfig<string>("Names", "FireBallSkill", M2Share.g_Config.sFireBallSkill);
            M2Share.g_Config.sHeavenSKill = GetConfig<string>("Names", "HeavenSKill", M2Share.g_Config.sHeavenSKill);                                                
            M2Share.g_Config.MeteorSKill = GetConfig<string>("Names", "MeteorSKill", M2Share.g_Config.MeteorSKill);
            M2Share.g_Config.sClothsMan = GetConfig<string>("Names", "ClothsMan", M2Share.g_Config.sClothsMan);
            M2Share.g_Config.sClothsWoman = GetConfig<string>("Names", "ClothsWoman", M2Share.g_Config.sClothsWoman);
            M2Share.g_Config.sWoodenSword = GetConfig<string>("Names", "WoodenSword", M2Share.g_Config.sWoodenSword);
            M2Share.g_Config.sCandle = GetConfig<string>("Names", "Candle", M2Share.g_Config.sCandle);
            M2Share.g_Config.sBasicDrug = GetConfig<string>("Names", "BasicDrug", M2Share.g_Config.sBasicDrug);
            M2Share.g_Config.sGoldStone = GetConfig<string>("Names", "GoldStone", M2Share.g_Config.sGoldStone);
            M2Share.g_Config.sSilverStone = GetConfig<string>("Names", "SilverStone", M2Share.g_Config.sSilverStone);
            M2Share.g_Config.sSteelStone = GetConfig<string>("Names", "SteelStone", M2Share.g_Config.sSteelStone);
            M2Share.g_Config.sCopperStone = GetConfig<string>("Names", "CopperStone", M2Share.g_Config.sCopperStone);
            M2Share.g_Config.sBlackStone = GetConfig<string>("Names", "BlackStone", M2Share.g_Config.sBlackStone);
            M2Share.g_Config.sZuma[0] = GetConfig<string>("Names", "Zuma1", M2Share.g_Config.sZuma[0]);
            M2Share.g_Config.sZuma[0] = GetConfig<string>("Names", "Zuma2", M2Share.g_Config.sZuma[0]);
            M2Share.g_Config.sZuma[2] = GetConfig<string>("Names", "Zuma3", M2Share.g_Config.sZuma[2]);
            M2Share.g_Config.sZuma[3] = GetConfig<string>("Names", "Zuma4", M2Share.g_Config.sZuma[3]);
            M2Share.g_Config.sBee = GetConfig<string>("Names", "Bee", M2Share.g_Config.sBee);
            M2Share.g_Config.sSpider = GetConfig<string>("Names", "Spider", M2Share.g_Config.sSpider);
            M2Share.g_Config.sWomaHorn = GetConfig<string>("Names", "WomaHorn", M2Share.g_Config.sWomaHorn);
            M2Share.g_Config.sZumaPiece = GetConfig<string>("Names", "ZumaPiece", M2Share.g_Config.sZumaPiece);
            M2Share.g_Config.sDogz = GetConfig<string>("Names", "Dogz", M2Share.g_Config.sDogz);
            M2Share.g_Config.sFairy = GetConfig<string>("Names", "Fairy", M2Share.g_Config.sFairy); // 月灵
            M2Share.g_Config.sBoneFamm = GetConfig<string>("Names", "BoneFamm", M2Share.g_Config.sBoneFamm);
            M2Share.g_Config.sGameGoldName = GetConfig<string>("Names", "GameGold", M2Share.g_Config.sGameGoldName);// 金刚石
            M2Share.g_Config.sGameDiaMond = GetConfig<string>("Names", "GameDiaMond", M2Share.g_Config.sGameDiaMond);  // 灵符
            M2Share.g_Config.sGameGird = GetConfig<string>("Names", "GameGird", M2Share.g_Config.sGameGird);// 灵符
            M2Share.g_Config.sGameGlory = GetConfig<string>("Names", "GameGlory", M2Share.g_Config.sGameGlory);// 荣誉
            M2Share.g_Config.sGamePointName = GetConfig<string>("Names", "GamePoint", M2Share.g_Config.sGamePointName);
            M2Share.g_Config.sPayMentPointName = GetConfig<string>("Names", "PayMentPointName", M2Share.g_Config.sPayMentPointName);
            // ============================================================================
            // 游戏设置
            M2Share.g_Config.nItemNumber = GetConfig<int>("Setup", "ItemNumber", M2Share.g_Config.nItemNumber);
            M2Share.g_Config.nItemNumberEx = GetConfig<int>("Setup", "ItemNumberEx", M2Share.g_Config.nItemNumberEx);
            M2Share.g_Config.sClientFile1 = GetConfig<string>("Setup", "ClientFile1", M2Share.g_Config.sClientFile1);
            M2Share.g_Config.nMonUpLvNeedKillBase = GetConfig<int>("Setup", "MonUpLvNeedKillBase", M2Share.g_Config.nMonUpLvNeedKillBase);
            M2Share.g_Config.nMonUpLvRate = GetConfig<ushort>("Setup", "MonUpLvRate", M2Share.g_Config.nMonUpLvRate);
            for (var i = M2Share.g_Config.MonUpLvNeedKillCount.GetLowerBound(0); i <= M2Share.g_Config.MonUpLvNeedKillCount.GetUpperBound(0); i++)
            {
                M2Share.g_Config.MonUpLvNeedKillCount[i] = GetConfig<ushort>("Setup", "MonUpLvNeedKillCount" + i, M2Share.g_Config.MonUpLvNeedKillCount[i]);
            }
            for (var i = M2Share.g_Config.SlaveColor.GetLowerBound(0); i <= M2Share.g_Config.SlaveColor.GetUpperBound(0); i++)
            {
                M2Share.g_Config.SlaveColor[i] = GetConfig<byte>("Setup", "SlaveColor" + i, M2Share.g_Config.SlaveColor[i]);
            }
            M2Share.g_Config.sHomeMap = GetConfig<string>("Setup", "HomeMap", M2Share.g_Config.sHomeMap);
            M2Share.g_Config.nHomeX = GetConfig<int>("Setup", "HomeX", M2Share.g_Config.nHomeX);
            M2Share.g_Config.nHomeY = GetConfig<int>("Setup", "HomeY", M2Share.g_Config.nHomeY);
            M2Share.g_Config.sRedHomeMap = GetConfig<string>("Setup", "RedHomeMap", M2Share.g_Config.sRedHomeMap);
            M2Share.g_Config.nRedHomeX = GetConfig<int>("Setup", "RedHomeX", M2Share.g_Config.nRedHomeX);
            M2Share.g_Config.nRedHomeY = GetConfig<int>("Setup", "RedHomeY", M2Share.g_Config.nRedHomeY);
            M2Share.g_Config.sRedDieHomeMap = GetConfig<string>("Setup", "RedDieHomeMap", M2Share.g_Config.sRedDieHomeMap);
            M2Share.g_Config.nRedDieHomeX = GetConfig<int>("Setup", "RedDieHomeX", M2Share.g_Config.nRedDieHomeX);
            M2Share.g_Config.nRedDieHomeY = GetConfig<int>("Setup", "RedDieHomeY", M2Share.g_Config.nRedDieHomeY);
            M2Share.g_Config.nHealthFillTime = GetConfig<int>("Setup", "HealthFillTime", M2Share.g_Config.nHealthFillTime);
            M2Share.g_Config.nSpellFillTime = GetConfig<int>("Setup", "SpellFillTime", M2Share.g_Config.nSpellFillTime);
            M2Share.g_Config.dwDecPkPointTime = GetConfig<uint>("Setup", "DecPkPointTime", M2Share.g_Config.dwDecPkPointTime);
            M2Share.g_Config.nDecPkPointCount = GetConfig<ushort>("Setup", "DecPkPointCount", M2Share.g_Config.nDecPkPointCount);
            M2Share.g_Config.dwPKFlagTime = GetConfig<uint>("Setup", "PKFlagTime", M2Share.g_Config.dwPKFlagTime);// 杀人武器被诅咒机率
            M2Share.g_Config.nKillHumanWeaponUnlockRate = GetConfig<byte>("Setup", "KillHumanWeaponUnlockRate", M2Share.g_Config.nKillHumanWeaponUnlockRate);
            M2Share.g_Config.nKillHumanAddPKPoint = GetConfig<ushort>("Setup", "KillHumanAddPKPoint", M2Share.g_Config.nKillHumanAddPKPoint);
            M2Share.g_Config.nKillHumanDecLuckPoint = GetConfig<ushort>("Setup", "KillHumanDecLuckPoint", M2Share.g_Config.nKillHumanDecLuckPoint);
            M2Share.g_Config.dwDecLightItemDrugTime = GetConfig<uint>("Setup", "DecLightItemDrugTime", M2Share.g_Config.dwDecLightItemDrugTime);
            M2Share.g_Config.nSafeZoneSize = GetConfig<ushort>("Setup", "SafeZoneSize", M2Share.g_Config.nSafeZoneSize);
            M2Share.g_Config.nStartPointSize = GetConfig<ushort>("Setup", "StartPointSize", M2Share.g_Config.nStartPointSize);
            for (var i = M2Share.g_Config.ReNewNameColor.GetLowerBound(0); i <= M2Share.g_Config.ReNewNameColor.GetUpperBound(0); i++)
            {
                M2Share.g_Config.ReNewNameColor[i] = GetConfig<byte>("Setup", "ReNewNameColor" + i, M2Share.g_Config.ReNewNameColor[i]);
            }
            M2Share.g_Config.dwReNewNameColorTime = GetConfig<uint>("Setup", "ReNewNameColorTime", M2Share.g_Config.dwReNewNameColorTime);
            M2Share.g_Config.boReNewChangeColor = GetConfig<bool>("Setup", "ReNewChangeColor", M2Share.g_Config.boReNewChangeColor);
            M2Share.g_Config.boReNewLevelClearExp = GetConfig<bool>("Setup", "ReNewLevelClearExp", M2Share.g_Config.boReNewLevelClearExp);
            M2Share.g_Config.BonusAbilofWarr.DC = GetConfig<ushort>("Setup", "BonusAbilofWarrDC", M2Share.g_Config.BonusAbilofWarr.DC);
            M2Share.g_Config.BonusAbilofWarr.MC = GetConfig<ushort>("Setup", "BonusAbilofWarrMC", M2Share.g_Config.BonusAbilofWarr.MC);
            M2Share.g_Config.BonusAbilofWarr.SC = GetConfig<ushort>("Setup", "BonusAbilofWarrSC", M2Share.g_Config.BonusAbilofWarr.SC);
            M2Share.g_Config.BonusAbilofWarr.AC = GetConfig<ushort>("Setup", "BonusAbilofWarrAC", M2Share.g_Config.BonusAbilofWarr.AC);
            M2Share.g_Config.BonusAbilofWarr.MAC = GetConfig<ushort>("Setup", "BonusAbilofWarrMAC", M2Share.g_Config.BonusAbilofWarr.MAC);
            M2Share.g_Config.BonusAbilofWarr.HP = GetConfig<int>("Setup", "BonusAbilofWarrHP", M2Share.g_Config.BonusAbilofWarr.HP);
            M2Share.g_Config.BonusAbilofWarr.MP = GetConfig<int>("Setup", "BonusAbilofWarrMP", M2Share.g_Config.BonusAbilofWarr.MP);
            M2Share.g_Config.BonusAbilofWarr.Hit = GetConfig<ushort>("Setup", "BonusAbilofWarrHit", M2Share.g_Config.BonusAbilofWarr.Hit);
            M2Share.g_Config.BonusAbilofWarr.Speed = GetConfig<ushort>("Setup", "BonusAbilofWarrSpeed", M2Share.g_Config.BonusAbilofWarr.Speed);
            M2Share.g_Config.BonusAbilofWarr.X2 = GetConfig<ushort>("Setup", "BonusAbilofWarrX2", M2Share.g_Config.BonusAbilofWarr.X2);
            M2Share.g_Config.BonusAbilofWizard.DC = GetConfig<ushort>("Setup", "BonusAbilofWizardDC", M2Share.g_Config.BonusAbilofWizard.DC);
            M2Share.g_Config.BonusAbilofWizard.MC = GetConfig<ushort>("Setup", "BonusAbilofWizardMC", M2Share.g_Config.BonusAbilofWizard.MC);
            M2Share.g_Config.BonusAbilofWizard.SC = GetConfig<ushort>("Setup", "BonusAbilofWizardSC", M2Share.g_Config.BonusAbilofWizard.SC);
            M2Share.g_Config.BonusAbilofWizard.AC = GetConfig<ushort>("Setup", "BonusAbilofWizardAC", M2Share.g_Config.BonusAbilofWizard.AC);
            M2Share.g_Config.BonusAbilofWizard.MAC = GetConfig<ushort>("Setup", "BonusAbilofWizardMAC", M2Share.g_Config.BonusAbilofWizard.MAC);
            M2Share.g_Config.BonusAbilofWizard.HP = GetConfig<int>("Setup", "BonusAbilofWizardHP", M2Share.g_Config.BonusAbilofWizard.HP);
            M2Share.g_Config.BonusAbilofWizard.MP = GetConfig<int>("Setup", "BonusAbilofWizardMP", M2Share.g_Config.BonusAbilofWizard.MP);
            M2Share.g_Config.BonusAbilofWizard.Hit = GetConfig<ushort>("Setup", "BonusAbilofWizardHit", M2Share.g_Config.BonusAbilofWizard.Hit);
            M2Share.g_Config.BonusAbilofWizard.Speed = GetConfig<ushort>("Setup", "BonusAbilofWizardSpeed", M2Share.g_Config.BonusAbilofWizard.Speed);
            M2Share.g_Config.BonusAbilofWizard.X2 = GetConfig<ushort>("Setup", "BonusAbilofWizardX2", M2Share.g_Config.BonusAbilofWizard.X2);
            M2Share.g_Config.BonusAbilofTaos.DC = GetConfig<ushort>("Setup", "BonusAbilofTaosDC", M2Share.g_Config.BonusAbilofTaos.DC);
            M2Share.g_Config.BonusAbilofTaos.MC = GetConfig<ushort>("Setup", "BonusAbilofTaosMC", M2Share.g_Config.BonusAbilofTaos.MC);
            M2Share.g_Config.BonusAbilofTaos.SC = GetConfig<ushort>("Setup", "BonusAbilofTaosSC", M2Share.g_Config.BonusAbilofTaos.SC);
            M2Share.g_Config.BonusAbilofTaos.AC = GetConfig<ushort>("Setup", "BonusAbilofTaosAC", M2Share.g_Config.BonusAbilofTaos.AC);
            M2Share.g_Config.BonusAbilofTaos.MAC = GetConfig<ushort>("Setup", "BonusAbilofTaosMAC", M2Share.g_Config.BonusAbilofTaos.MAC);
            M2Share.g_Config.BonusAbilofTaos.HP = GetConfig<int>("Setup", "BonusAbilofTaosHP", M2Share.g_Config.BonusAbilofTaos.HP);
            M2Share.g_Config.BonusAbilofTaos.MP = GetConfig<int>("Setup", "BonusAbilofTaosMP", M2Share.g_Config.BonusAbilofTaos.MP);
            M2Share.g_Config.BonusAbilofTaos.Hit = GetConfig<ushort>("Setup", "BonusAbilofTaosHit", M2Share.g_Config.BonusAbilofTaos.Hit);
            M2Share.g_Config.BonusAbilofTaos.Speed = GetConfig<ushort>("Setup", "BonusAbilofTaosSpeed", M2Share.g_Config.BonusAbilofTaos.Speed);
            M2Share.g_Config.BonusAbilofTaos.X2 = GetConfig<ushort>("Setup", "BonusAbilofTaosX2", M2Share.g_Config.BonusAbilofTaos.X2);
            M2Share.g_Config.NakedAbilofWarr.DC = GetConfig<ushort>("Setup", "NakedAbilofWarrDC", M2Share.g_Config.NakedAbilofWarr.DC);
            M2Share.g_Config.NakedAbilofWarr.MC = GetConfig<ushort>("Setup", "NakedAbilofWarrMC", M2Share.g_Config.NakedAbilofWarr.MC);
            M2Share.g_Config.NakedAbilofWarr.SC = GetConfig<ushort>("Setup", "NakedAbilofWarrSC", M2Share.g_Config.NakedAbilofWarr.SC);
            M2Share.g_Config.NakedAbilofWarr.AC = GetConfig<ushort>("Setup", "NakedAbilofWarrAC", M2Share.g_Config.NakedAbilofWarr.AC);
            M2Share.g_Config.NakedAbilofWarr.MAC = GetConfig<ushort>("Setup", "NakedAbilofWarrMAC", M2Share.g_Config.NakedAbilofWarr.MAC);
            M2Share.g_Config.NakedAbilofWarr.HP = GetConfig<int>("Setup", "NakedAbilofWarrHP", M2Share.g_Config.NakedAbilofWarr.HP);
            M2Share.g_Config.NakedAbilofWarr.MP = GetConfig<int>("Setup", "NakedAbilofWarrMP", M2Share.g_Config.NakedAbilofWarr.MP);
            M2Share.g_Config.NakedAbilofWarr.Hit = GetConfig<ushort>("Setup", "NakedAbilofWarrHit", M2Share.g_Config.NakedAbilofWarr.Hit);
            M2Share.g_Config.NakedAbilofWarr.Speed = GetConfig<ushort>("Setup", "NakedAbilofWarrSpeed", M2Share.g_Config.NakedAbilofWarr.Speed);
            M2Share.g_Config.NakedAbilofWarr.X2 = GetConfig<ushort>("Setup", "NakedAbilofWarrX2", M2Share.g_Config.NakedAbilofWarr.X2);
            M2Share.g_Config.NakedAbilofWizard.DC = GetConfig<ushort>("Setup", "NakedAbilofWizardDC", M2Share.g_Config.NakedAbilofWizard.DC);
            M2Share.g_Config.NakedAbilofWizard.MC = GetConfig<ushort>("Setup", "NakedAbilofWizardMC", M2Share.g_Config.NakedAbilofWizard.MC);
            M2Share.g_Config.NakedAbilofWizard.SC = GetConfig<ushort>("Setup", "NakedAbilofWizardSC", M2Share.g_Config.NakedAbilofWizard.SC);
            M2Share.g_Config.NakedAbilofWizard.AC = GetConfig<ushort>("Setup", "NakedAbilofWizardAC", M2Share.g_Config.NakedAbilofWizard.AC);
            M2Share.g_Config.NakedAbilofWizard.MAC = GetConfig<ushort>("Setup", "NakedAbilofWizardMAC", M2Share.g_Config.NakedAbilofWizard.MAC);
            M2Share.g_Config.NakedAbilofWizard.HP = GetConfig<int>("Setup", "NakedAbilofWizardHP", M2Share.g_Config.NakedAbilofWizard.HP);
            M2Share.g_Config.NakedAbilofWizard.MP = GetConfig<int>("Setup", "NakedAbilofWizardMP", M2Share.g_Config.NakedAbilofWizard.MP);
            M2Share.g_Config.NakedAbilofWizard.Hit = GetConfig<ushort>("Setup", "NakedAbilofWizardHit", M2Share.g_Config.NakedAbilofWizard.Hit);
            M2Share.g_Config.NakedAbilofWizard.Speed = GetConfig<ushort>("Setup", "NakedAbilofWizardSpeed", M2Share.g_Config.NakedAbilofWizard.Speed);
            M2Share.g_Config.NakedAbilofWizard.X2 = GetConfig<ushort>("Setup", "NakedAbilofWizardX2", M2Share.g_Config.NakedAbilofWizard.X2);
            M2Share.g_Config.NakedAbilofTaos.DC = GetConfig<ushort>("Setup", "NakedAbilofTaosDC", M2Share.g_Config.NakedAbilofTaos.DC);
            M2Share.g_Config.NakedAbilofTaos.MC = GetConfig<ushort>("Setup", "NakedAbilofTaosMC", M2Share.g_Config.NakedAbilofTaos.MC);
            M2Share.g_Config.NakedAbilofTaos.SC = GetConfig<ushort>("Setup", "NakedAbilofTaosSC", M2Share.g_Config.NakedAbilofTaos.SC);
            M2Share.g_Config.NakedAbilofTaos.AC = GetConfig<ushort>("Setup", "NakedAbilofTaosAC", M2Share.g_Config.NakedAbilofTaos.AC);
            M2Share.g_Config.NakedAbilofTaos.MAC = GetConfig<ushort>("Setup", "NakedAbilofTaosMAC", M2Share.g_Config.NakedAbilofTaos.MAC);
            M2Share.g_Config.NakedAbilofTaos.HP = GetConfig<int>("Setup", "NakedAbilofTaosHP", M2Share.g_Config.NakedAbilofTaos.HP);
            M2Share.g_Config.NakedAbilofTaos.MP = GetConfig<int>("Setup", "NakedAbilofTaosMP", M2Share.g_Config.NakedAbilofTaos.MP);
            M2Share.g_Config.NakedAbilofTaos.Hit = GetConfig<ushort>("Setup", "NakedAbilofTaosHit", M2Share.g_Config.NakedAbilofTaos.Hit);
            M2Share.g_Config.NakedAbilofTaos.Speed = GetConfig<ushort>("Setup", "NakedAbilofTaosSpeed", M2Share.g_Config.NakedAbilofTaos.Speed);
            M2Share.g_Config.NakedAbilofTaos.X2 = GetConfig<ushort>("Setup", "NakedAbilofTaosX2", M2Share.g_Config.NakedAbilofTaos.X2);
            M2Share.g_Config.nGuildMemberCount = GetConfig<ushort>("Setup", "GuildMemberCount", M2Share.g_Config.nGuildMemberCount); // 新建行会成员上限 20090115
            M2Share.g_Config.nGroupMembersMax = GetConfig<ushort>("Setup", "GroupMembersMax", M2Share.g_Config.nGroupMembersMax);
            M2Share.g_Config.dwUPgradeWeaponGetBackTime = GetConfig<uint>("Setup", "UPgradeWeaponGetBackTime", M2Share.g_Config.dwUPgradeWeaponGetBackTime);
            M2Share.g_Config.nClearExpireUpgradeWeaponDays = GetConfig<byte>("Setup", "ClearExpireUpgradeWeaponDays", M2Share.g_Config.nClearExpireUpgradeWeaponDays);
            M2Share.g_Config.nUpgradeWeaponPrice = GetConfig<int>("Setup", "UpgradeWeaponPrice", M2Share.g_Config.nUpgradeWeaponPrice);
            M2Share.g_Config.nUpgradeWeaponMaxPoint = GetConfig<ushort>("Setup", "UpgradeWeaponMaxPoint", M2Share.g_Config.nUpgradeWeaponMaxPoint);
            M2Share.g_Config.nUpgradeWeaponDCRate = GetConfig<ushort>("Setup", "UpgradeWeaponDCRate", M2Share.g_Config.nUpgradeWeaponDCRate);
            M2Share.g_Config.nUpgradeWeaponDCTwoPointRate = GetConfig<ushort>("Setup", "UpgradeWeaponDCTwoPointRate", M2Share.g_Config.nUpgradeWeaponDCTwoPointRate);
            M2Share.g_Config.nUpgradeWeaponDCThreePointRate = GetConfig<ushort>("Setup", "UpgradeWeaponDCThreePointRate", M2Share.g_Config.nUpgradeWeaponDCThreePointRate);
            M2Share.g_Config.nUpgradeWeaponMCRate = GetConfig<ushort>("Setup", "UpgradeWeaponMCRate", M2Share.g_Config.nUpgradeWeaponMCRate);
            M2Share.g_Config.nUpgradeWeaponMCTwoPointRate = GetConfig<ushort>("Setup", "UpgradeWeaponMCTwoPointRate", M2Share.g_Config.nUpgradeWeaponMCTwoPointRate);
            M2Share.g_Config.nUpgradeWeaponMCThreePointRate = GetConfig<ushort>("Setup", "UpgradeWeaponMCThreePointRate", M2Share.g_Config.nUpgradeWeaponMCThreePointRate);
            M2Share.g_Config.nUpgradeWeaponSCRate = GetConfig<ushort>("Setup", "UpgradeWeaponSCRate", M2Share.g_Config.nUpgradeWeaponSCRate);
            M2Share.g_Config.nUpgradeWeaponSCTwoPointRate = GetConfig<ushort>("Setup", "UpgradeWeaponSCTwoPointRate", M2Share.g_Config.nUpgradeWeaponSCTwoPointRate);
            M2Share.g_Config.nUpgradeWeaponSCThreePointRate = GetConfig<ushort>("Setup", "UpgradeWeaponSCThreePointRate", M2Share.g_Config.nUpgradeWeaponSCThreePointRate);
            M2Share.g_Config.nBuildGuildPrice = GetConfig<int>("Setup", "BuildGuild", M2Share.g_Config.nBuildGuildPrice);
            M2Share.g_Config.nMakeDurgPrice = GetConfig<int>("Setup", "MakeDurg", M2Share.g_Config.nMakeDurgPrice);
            M2Share.g_Config.nGuildWarPrice = GetConfig<int>("Setup", "GuildWarFee", M2Share.g_Config.nGuildWarPrice);
            M2Share.g_Config.HireGuardPrice = GetConfig<int>("Setup", "HireGuard", M2Share.g_Config.HireGuardPrice);
            M2Share.g_Config.nHireArcherPrice = GetConfig<int>("Setup", "HireArcher", M2Share.g_Config.nHireArcherPrice);
            M2Share.g_Config.RepairDoorPrice = GetConfig<int>("Setup", "RepairDoor", M2Share.g_Config.RepairDoorPrice);
            M2Share.g_Config.RepairWallPrice = GetConfig<int>("Setup", "RepairWall", M2Share.g_Config.RepairWallPrice);
            M2Share.g_Config.nCastleMemberPriceRate = GetConfig<byte>("Setup", "CastleMemberPriceRate", M2Share.g_Config.nCastleMemberPriceRate);
            M2Share.g_Config.CastleGoldMax = GetConfig<int>("Setup", "CastleGoldMax", M2Share.g_Config.CastleGoldMax);
            M2Share.g_Config.CastleOneDayGold = GetConfig<int>("Setup", "CastleOneDayGold", M2Share.g_Config.CastleOneDayGold);
            M2Share.g_Config.sCASTLENAME = GetConfig<string>("Setup", "CastleName", M2Share.g_Config.sCASTLENAME);
            M2Share.g_Config.sCastleHomeMap = GetConfig<string>("Setup", "CastleHomeMap", M2Share.g_Config.sCastleHomeMap);
            M2Share.g_Config.nCastleHomeX = GetConfig<int>("Setup", "CastleHomeX", M2Share.g_Config.nCastleHomeX);
            M2Share.g_Config.nCastleHomeY = GetConfig<int>("Setup", "CastleHomeY", M2Share.g_Config.nCastleHomeY);
            M2Share.g_Config.nCastleWarRangeX = GetConfig<int>("Setup", "CastleWarRangeX", M2Share.g_Config.nCastleWarRangeX);
            M2Share.g_Config.nCastleWarRangeY = GetConfig<int>("Setup", "CastleWarRangeY", M2Share.g_Config.nCastleWarRangeY);
            M2Share.g_Config.nCastleTaxRate = GetConfig<ushort>("Setup", "CastleTaxRate", M2Share.g_Config.nCastleTaxRate);
            M2Share.g_Config.boGetAllNpcTax = GetConfig<bool>("Setup", "CastleGetAllNpcTax", M2Share.g_Config.boGetAllNpcTax);
            M2Share.g_Config.nMonGenRate = GetConfig<ushort>("Setup", "GenMonRate", M2Share.g_Config.nMonGenRate);
            M2Share.g_Config.nHumanMaxGold = GetConfig<int>("Setup", "HumanMaxGold", M2Share.g_Config.nHumanMaxGold);
            M2Share.g_Config.nHumanTryModeMaxGold = GetConfig<int>("Setup", "HumanTryModeMaxGold", M2Share.g_Config.nHumanTryModeMaxGold);
            M2Share.g_Config.nTryModeLevel = GetConfig<byte>("Setup", "TryModeLevel", M2Share.g_Config.nTryModeLevel);
            M2Share.g_Config.boTryModeUseStorage = GetConfig<bool>("Setup", "TryModeUseStorage", M2Share.g_Config.boTryModeUseStorage);
            M2Share.g_Config.boShutRedMsgShowGMName = GetConfig<bool>("Setup", "ShutRedMsgShowGMName", M2Share.g_Config.boShutRedMsgShowGMName);
            M2Share.g_Config.boShowMakeItemMsg = GetConfig<bool>("Setup", "ShowMakeItemMsg", M2Share.g_Config.boShowMakeItemMsg);
            // 人物名是否显示行会信息
            M2Share.g_Config.boShowGuildName = GetConfig<bool>("Setup", "ShowGuildName", M2Share.g_Config.boShowGuildName);
            M2Share.g_Config.boShowRankLevelName = GetConfig<bool>("Setup", "ShowRankLevelName", M2Share.g_Config.boShowRankLevelName);
            M2Share.g_Config.boMonSayMsg = GetConfig<bool>("Setup", "MonSayMsg", M2Share.g_Config.boMonSayMsg);
            M2Share.g_Config.nSayMsgMaxLen = GetConfig<byte>("Setup", "SayMsgMaxLen", M2Share.g_Config.nSayMsgMaxLen);
            M2Share.g_Config.dwSayMsgTime = GetConfig<uint>("Setup", "SayMsgTime", M2Share.g_Config.dwSayMsgTime);
            M2Share.g_Config.nSayMsgCount = GetConfig<byte>("Setup", "SayMsgCount", M2Share.g_Config.nSayMsgCount);
            M2Share.g_Config.dwDisableSayMsgTime = GetConfig<uint>("Setup", "DisableSayMsgTime", M2Share.g_Config.dwDisableSayMsgTime);
            M2Share.g_Config.nSayRedMsgMaxLen = GetConfig<byte>("Setup", "SayRedMsgMaxLen", M2Share.g_Config.nSayRedMsgMaxLen);
            M2Share.g_Config.nCanShoutMsgLevel = GetConfig<ushort>("Setup", "CanShoutMsgLevel", M2Share.g_Config.nCanShoutMsgLevel);
            M2Share.g_Config.nStartPermission = GetConfig<byte>("Setup", "StartPermission", M2Share.g_Config.nStartPermission);
            M2Share.g_Config.nSendRefMsgRange = GetConfig<byte>("Setup", "SendRefMsgRange", M2Share.g_Config.nSendRefMsgRange);
            M2Share.g_Config.boDecLampDura = GetConfig<bool>("Setup", "DecLampDura", M2Share.g_Config.boDecLampDura);
            M2Share.g_Config.boHungerSystem = GetConfig<bool>("Setup", "HungerSystem", M2Share.g_Config.boHungerSystem);
            M2Share.g_Config.boHungerDecHP = GetConfig<bool>("Setup", "HungerDecHP", M2Share.g_Config.boHungerDecHP);
            M2Share.g_Config.boHungerDecPower = GetConfig<bool>("Setup", "HungerDecPower", M2Share.g_Config.boHungerDecPower);
            M2Share.g_Config.boDiableHumanRun = GetConfig<bool>("Setup", "DiableHumanRun", M2Share.g_Config.boDiableHumanRun);
            M2Share.g_Config.boRUNHUMAN = GetConfig<bool>("Setup", "RunHuman", M2Share.g_Config.boRUNHUMAN);
            M2Share.g_Config.boRUNMON = GetConfig<bool>("Setup", "RunMon", M2Share.g_Config.boRUNMON);
            M2Share.g_Config.boRunNpc = GetConfig<bool>("Setup", "RunNpc", M2Share.g_Config.boRunNpc);
            M2Share.g_Config.boWarDisHumRun = GetConfig<bool>("Setup", "WarDisableHumanRun", M2Share.g_Config.boWarDisHumRun);// 魔法盾效果 T-特色效果 F-盛大效果 20080808
            M2Share.g_Config.boSkill31Effect = GetConfig<bool>("Setup", "Skill31Effect", M2Share.g_Config.boSkill31Effect);
            M2Share.g_Config.nSkill66Rate = GetConfig<byte>("Setup", "Skill66Rate", M2Share.g_Config.nSkill66Rate);// 四级魔法盾抵御伤害百分率 20080829
            M2Share.g_Config.nOrdinarySkill66Rate = GetConfig<byte>("Setup", "OrdinarySkill66Rate", M2Share.g_Config.nOrdinarySkill66Rate);// 普通魔法盾抵御伤害百分率 20081226
            if (M2Share.g_Config.nOrdinarySkill66Rate > 20)
            {
                M2Share.g_Config.nOrdinarySkill66Rate = 20;
            }
            M2Share.g_Config.nNGSkillRate = GetConfig<ushort>("Setup", "NGSkillRate", M2Share.g_Config.nNGSkillRate);// 内功技能增强的攻防比率 
            M2Share.g_Config.nNGLevelDamage = GetConfig<byte>("Setup", "NGLevelDamage", M2Share.g_Config.nNGLevelDamage); // 内功等级增加攻防的级数比率 
            M2Share.g_Config.nSkill69NG = GetConfig<byte>("Setup", "Skill69NG", M2Share.g_Config.nSkill69NG);  // 内力值参数 
            M2Share.g_Config.nSkill69NGExp = GetConfig<uint>("Setup", "Skill69NGExp", M2Share.g_Config.nSkill69NGExp);// 主体内功经验参数 20081001
            M2Share.g_Config.nHeroSkill69NGExp = GetConfig<uint>("Setup", "HeroSkill69NGExp", M2Share.g_Config.nHeroSkill69NGExp); // 英雄内功经验参数 20081001
            M2Share.g_Config.dwIncNHTime = GetConfig<uint>("Setup", "dwIncNHTime", M2Share.g_Config.dwIncNHTime); // 增加内力值间隔 20081002
            M2Share.g_Config.nDrinkIncNHExp = GetConfig<int>("Setup", "DrinkIncNHExp", M2Share.g_Config.nDrinkIncNHExp);// 饮酒增加内功经验 20081003
            M2Share.g_Config.nHitStruckDecNH = GetConfig<ushort>("Setup", "HitStruckDecNH", M2Share.g_Config.nHitStruckDecNH);// 内功抵御普通攻击消耗内力值 20081003
            M2Share.g_Config.boGMRunAll = GetConfig<bool>("Setup", "GMRunAll", M2Share.g_Config.boGMRunAll);
            M2Share.g_Config.boSafeAreaLimited = GetConfig<bool>("Setup", "SafeAreaLimitedRun", M2Share.g_Config.boSafeAreaLimited);
            M2Share.g_Config.nBoneFammCount = GetConfig<byte>("Setup", "BoneFammCount", M2Share.g_Config.nBoneFammCount);
            for (var i = M2Share.g_Config.BoneFammArray.GetLowerBound(0); i <= M2Share.g_Config.BoneFammArray.GetUpperBound(0); i++)
            {
                M2Share.g_Config.BoneFammArray[i].nHumLevel = GetConfig<int>("Setup", "BoneFammHumLevel" + i, M2Share.g_Config.BoneFammArray[i].nHumLevel);
                M2Share.g_Config.BoneFammArray[i].sMonName = GetConfig<string>("Names", "BoneFamm" + i, M2Share.g_Config.BoneFammArray[i].sMonName);
                M2Share.g_Config.BoneFammArray[i].nCount = GetConfig<int>("Setup", "BoneFammCount" + i, M2Share.g_Config.BoneFammArray[i].nCount);
                M2Share.g_Config.BoneFammArray[i].nLevel = GetConfig<int>("Setup", "BoneFammLevel" + i, M2Share.g_Config.BoneFammArray[i].nLevel);
            }
            M2Share.g_Config.nDogzCount = GetConfig<byte>("Setup", "DogzCount", M2Share.g_Config.nDogzCount);
            for (var i = M2Share.g_Config.DogzArray.GetLowerBound(0); i <= M2Share.g_Config.DogzArray.GetUpperBound(0); i++)
            {
                M2Share.g_Config.DogzArray[i].nHumLevel = GetConfig<int>("Setup", "DogzHumLevel" + i, M2Share.g_Config.DogzArray[i].nHumLevel);
                M2Share.g_Config.DogzArray[i].sMonName = GetConfig<string>("Names", "Dogz" + i, M2Share.g_Config.DogzArray[i].sMonName);
                M2Share.g_Config.DogzArray[i].nCount = GetConfig<int>("Setup", "DogzCount" + i, M2Share.g_Config.DogzArray[i].nCount);
                M2Share.g_Config.DogzArray[i].nLevel = GetConfig<int>("Setup", "DogzLevel" + i, M2Share.g_Config.DogzArray[i].nLevel);
            }
            M2Share.g_Config.nFairyCount = GetConfig<byte>("Setup", "FairyCount", M2Share.g_Config.nFairyCount); // 月灵
            M2Share.g_Config.nFairyDuntRate = GetConfig<byte>("Setup", "FairyDuntRate", M2Share.g_Config.nFairyDuntRate);// 月灵重击次数,达到次数时按等级出重击 
            M2Share.g_Config.nFairyDuntRateBelow = GetConfig<byte>("Setup", "FairyDuntRateBelow", M2Share.g_Config.nFairyDuntRateBelow);
            M2Share.g_Config.nFairyAttackRate = GetConfig<byte>("Setup", "FairyAttackRate", M2Share.g_Config.nFairyAttackRate);
            M2Share.g_Config.n43KillHitRate = GetConfig<byte>("Setup", "43KillHitRate", M2Share.g_Config.n43KillHitRate); // 开天斩重击几率 20080213
            M2Share.g_Config.n43KillAttackRate = GetConfig<byte>("Setup", "43KillAttackRate", M2Share.g_Config.n43KillAttackRate); // 开天斩重击倍数  20080213
            M2Share.g_Config.nAttackRate_43 = GetConfig<ushort>("Setup", "AttackRate_43", M2Share.g_Config.nAttackRate_43);// 开天斩威力 20080213
            M2Share.g_Config.nAttackRate_26 = GetConfig<ushort>("Setup", "AttackRate_26", M2Share.g_Config.nAttackRate_26); // 烈火剑法威力倍数 20081208
            M2Share.g_Config.nAttackRate_74 = GetConfig<ushort>("Setup", "AttackRate_74", M2Share.g_Config.nAttackRate_74);// 逐日剑法威力倍数 
            for (var i = M2Share.g_Config.FairyArray.GetLowerBound(0); i <= M2Share.g_Config.FairyArray.GetUpperBound(0); i++)
            {
                M2Share.g_Config.FairyArray[i].nHumLevel = GetConfig<int>("Setup", "FairyHumLevel" + i, M2Share.g_Config.FairyArray[i].nHumLevel);
                M2Share.g_Config.FairyArray[i].sMonName = GetConfig<string>("Names", "Fairy" + i, M2Share.g_Config.FairyArray[i].sMonName);
                M2Share.g_Config.FairyArray[i].nCount = GetConfig<int>("Setup", "FairyCount" + i, M2Share.g_Config.FairyArray[i].nCount);
                M2Share.g_Config.FairyArray[i].nLevel = GetConfig<int>("Setup", "FairyLevel" + i, M2Share.g_Config.FairyArray[i].nLevel);
            }
            M2Share.g_Config.dwTryDealTime = GetConfig<uint>("Setup", "TryDealTime", M2Share.g_Config.dwTryDealTime);
            M2Share.g_Config.dwDealOKTime = GetConfig<uint>("Setup", "DealOKTime", M2Share.g_Config.dwDealOKTime);
            M2Share.g_Config.boCanNotGetBackDeal = GetConfig<bool>("Setup", "CanNotGetBackDeal", M2Share.g_Config.boCanNotGetBackDeal);
            M2Share.g_Config.boDisableDeal = GetConfig<bool>("Setup", "DisableDeal", M2Share.g_Config.boDisableDeal);// 可收徒弟数
            M2Share.g_Config.nMasterCount = GetConfig<byte>("Setup", "MasterCount", M2Share.g_Config.nMasterCount);
            M2Share.g_Config.nMasterOKLevel = GetConfig<ushort>("Setup", "MasterOKLevel", M2Share.g_Config.nMasterOKLevel);
            M2Share.g_Config.nMasterOKCreditPoint = GetConfig<byte>("Setup", "MasterOKCreditPoint", M2Share.g_Config.nMasterOKCreditPoint);
            M2Share.g_Config.nMasterOKBonusPoint = GetConfig<ushort>("Setup", "MasterOKBonusPoint", M2Share.g_Config.nMasterOKBonusPoint);
            M2Share.g_Config.boPKLevelProtect = GetConfig<bool>("Setup", "PKProtect", M2Share.g_Config.boPKLevelProtect);
            M2Share.g_Config.nPKProtectLevel = GetConfig<ushort>("Setup", "PKProtectLevel", M2Share.g_Config.nPKProtectLevel);
            M2Share.g_Config.nRedPKProtectLevel = GetConfig<ushort>("Setup", "RedPKProtectLevel", M2Share.g_Config.nRedPKProtectLevel);
            M2Share.g_Config.nItemPowerRate = GetConfig<ushort>("Setup", "ItemPowerRate", M2Share.g_Config.nItemPowerRate);
            M2Share.g_Config.nItemExpRate = GetConfig<ushort>("Setup", "ItemExpRate", M2Share.g_Config.nItemExpRate);
            M2Share.g_Config.nScriptGotoCountLimit = GetConfig<ushort>("Setup", "ScriptGotoCountLimit", M2Share.g_Config.nScriptGotoCountLimit);
            M2Share.g_Config.btHearMsgFColor = GetConfig<byte>("Setup", "HearMsgFColor", M2Share.g_Config.btHearMsgFColor);
            M2Share.g_Config.btHearMsgBColor = GetConfig<byte>("Setup", "HearMsgBColor", M2Share.g_Config.btHearMsgBColor);
            M2Share.g_Config.btWhisperMsgFColor = GetConfig<byte>("Setup", "WhisperMsgFColor", M2Share.g_Config.btWhisperMsgFColor);
            M2Share.g_Config.btWhisperMsgBColor = GetConfig<byte>("Setup", "WhisperMsgBColor", M2Share.g_Config.btWhisperMsgBColor);
            M2Share.g_Config.btGMWhisperMsgFColor = GetConfig<byte>("Setup", "GMWhisperMsgFColor", M2Share.g_Config.btGMWhisperMsgFColor);
            M2Share.g_Config.btGMWhisperMsgBColor = GetConfig<byte>("Setup", "GMWhisperMsgBColor", M2Share.g_Config.btGMWhisperMsgBColor);
            M2Share.g_Config.btCryMsgFColor = GetConfig<byte>("Setup", "CryMsgFColor", M2Share.g_Config.btCryMsgFColor);
            M2Share.g_Config.btCryMsgBColor = GetConfig<byte>("Setup", "CryMsgBColor", M2Share.g_Config.btCryMsgBColor);
            M2Share.g_Config.btGreenMsgFColor = GetConfig<byte>("Setup", "GreenMsgFColor", M2Share.g_Config.btGreenMsgFColor);
            M2Share.g_Config.btGreenMsgBColor = GetConfig<byte>("Setup", "GreenMsgBColor", M2Share.g_Config.btGreenMsgBColor);
            M2Share.g_Config.btBlueMsgFColor = GetConfig<byte>("Setup", "BlueMsgFColor", M2Share.g_Config.btBlueMsgFColor);
            M2Share.g_Config.btBlueMsgBColor = GetConfig<byte>("Setup", "BlueMsgBColor", M2Share.g_Config.btBlueMsgBColor);// 千里传音
            M2Share.g_Config.btSayMsgFColor = GetConfig<byte>("Setup", "SayMsgFColor", M2Share.g_Config.btSayMsgFColor);
            M2Share.g_Config.btSayeMsgBColor = GetConfig<byte>("Setup", "SayeMsgBColor", M2Share.g_Config.btSayeMsgBColor);
            M2Share.g_Config.btRedMsgFColor = GetConfig<byte>("Setup", "RedMsgFColor", M2Share.g_Config.btRedMsgFColor);
            M2Share.g_Config.btRedMsgBColor = GetConfig<byte>("Setup", "RedMsgBColor", M2Share.g_Config.btRedMsgBColor);
            M2Share.g_Config.btGuildMsgFColor = GetConfig<byte>("Setup", "GuildMsgFColor", M2Share.g_Config.btGuildMsgFColor);
            M2Share.g_Config.btGuildMsgBColor = GetConfig<byte>("Setup", "GuildMsgBColor", M2Share.g_Config.btGuildMsgBColor);
            M2Share.g_Config.btGroupMsgFColor = GetConfig<byte>("Setup", "GroupMsgFColor", M2Share.g_Config.btGroupMsgFColor);
            M2Share.g_Config.btGroupMsgBColor = GetConfig<byte>("Setup", "GroupMsgBColor", M2Share.g_Config.btGroupMsgBColor);
            M2Share.g_Config.btCustMsgFColor = GetConfig<byte>("Setup", "CustMsgFColor", M2Share.g_Config.btCustMsgFColor);
            M2Share.g_Config.btCustMsgBColor = GetConfig<byte>("Setup", "CustMsgBColor", M2Share.g_Config.btCustMsgBColor);
            M2Share.g_Config.nMonRandomAddValue = GetConfig<byte>("Setup", "MonRandomAddValue", M2Share.g_Config.nMonRandomAddValue);
            M2Share.g_Config.nMakeRandomAddValue = GetConfig<byte>("Setup", "MakeRandomAddValue", M2Share.g_Config.nMakeRandomAddValue);// 人形身上装备极品机率
            M2Share.g_Config.nPlayMonRandomAddValue = GetConfig<byte>("Setup", "PlayMonRandomAddValue", M2Share.g_Config.nPlayMonRandomAddValue);
            // -------------气血石配置------------------------------
            M2Share.g_Config.nStartHPRock = GetConfig<ushort>("Setup", "StartHPRock", M2Share.g_Config.nStartHPRock);
            M2Share.g_Config.nRockAddHP = GetConfig<byte>("Setup", "RockAddHP", M2Share.g_Config.nRockAddHP);
            M2Share.g_Config.nHPRockSpell = GetConfig<uint>("Setup", "HPRockSpell", M2Share.g_Config.nHPRockSpell);
            M2Share.g_Config.nHPRockDecDura = GetConfig<int>("Setup", "HPRockDecDura", M2Share.g_Config.nHPRockDecDura);
            M2Share.g_Config.nStartMPRock = GetConfig<byte>("Setup", "StartMPRock", M2Share.g_Config.nStartMPRock);
            M2Share.g_Config.nRockAddMP = GetConfig<byte>("Setup", "RockAddMP", M2Share.g_Config.nRockAddMP);
            M2Share.g_Config.nMPRockSpell = GetConfig<uint>("Setup", "MPRockSpell", M2Share.g_Config.nMPRockSpell);
            M2Share.g_Config.nMPRockDecDura = GetConfig<int>("Setup", "MPRockDecDura", M2Share.g_Config.nMPRockDecDura);
            M2Share.g_Config.nStartHPMPRock = GetConfig<ushort>("Setup", "StartHPMPRock", M2Share.g_Config.nStartHPMPRock);
            M2Share.g_Config.nRockAddHPMP = GetConfig<byte>("Setup", "RockAddHPMP", M2Share.g_Config.nRockAddHPMP);
            M2Share.g_Config.nHPMPRockSpell = GetConfig<uint>("Setup", "HPMPRockSpell", M2Share.g_Config.nHPMPRockSpell);
            M2Share.g_Config.nHPMPRockDecDura = GetConfig<int>("Setup", "HPMPRockDecDura", M2Share.g_Config.nHPMPRockDecDura);
            // ---------------------------------------------
            M2Share.g_Config.nWeaponDCAddValueMaxLimit = GetConfig<byte>("Setup", "WeaponDCAddValueMaxLimit", M2Share.g_Config.nWeaponDCAddValueMaxLimit);
            M2Share.g_Config.nWeaponDCAddValueRate = GetConfig<byte>("Setup", "WeaponDCAddValueRate", M2Share.g_Config.nWeaponDCAddValueRate);
            M2Share.g_Config.nWeaponMCAddValueMaxLimit = GetConfig<byte>("Setup", "WeaponMCAddValueMaxLimit", M2Share.g_Config.nWeaponMCAddValueMaxLimit);
            M2Share.g_Config.nWeaponMCAddValueRate = GetConfig<byte>("Setup", "WeaponMCAddValueRate", M2Share.g_Config.nWeaponMCAddValueRate);
            M2Share.g_Config.nWeaponSCAddValueMaxLimit = GetConfig<byte>("Setup", "WeaponSCAddValueMaxLimit", M2Share.g_Config.nWeaponSCAddValueMaxLimit);
            M2Share.g_Config.nWeaponSCAddValueRate = GetConfig<byte>("Setup", "WeaponSCAddValueRate", M2Share.g_Config.nWeaponSCAddValueRate);
            M2Share.g_Config.nWeaponDCAddRate = GetConfig<byte>("Setup", "WeaponDCAddRate", M2Share.g_Config.nWeaponDCAddRate);
            M2Share.g_Config.nWeaponSCAddRate = GetConfig<byte>("Setup", "WeaponSCAddRate", M2Share.g_Config.nWeaponSCAddRate);
            M2Share.g_Config.nWeaponMCAddRate = GetConfig<byte>("Setup", "WeaponMCAddRate", M2Share.g_Config.nWeaponMCAddRate);
            M2Share.g_Config.nDressDCAddValueMaxLimit = GetConfig<byte>("Setup", "DressDCAddValueMaxLimit", M2Share.g_Config.nDressDCAddValueMaxLimit);
            M2Share.g_Config.nDressDCAddValueRate = GetConfig<byte>("Setup", "DressDCAddValueRate", M2Share.g_Config.nDressDCAddValueRate);
            M2Share.g_Config.nDressDCAddRate = GetConfig<byte>("Setup", "DressDCAddRate", M2Share.g_Config.nDressDCAddRate);
            M2Share.g_Config.nDressMCAddValueMaxLimit = GetConfig<byte>("Setup", "DressMCAddValueMaxLimit", M2Share.g_Config.nDressMCAddValueMaxLimit);
            M2Share.g_Config.nDressMCAddValueRate = GetConfig<byte>("Setup", "DressMCAddValueRate", M2Share.g_Config.nDressMCAddValueRate);
            M2Share.g_Config.nDressMCAddRate = GetConfig<byte>("Setup", "DressMCAddRate", M2Share.g_Config.nDressMCAddRate);
            M2Share.g_Config.nDressSCAddValueMaxLimit = GetConfig<byte>("Setup", "DressSCAddValueMaxLimit", M2Share.g_Config.nDressSCAddValueMaxLimit);
            M2Share.g_Config.nDressSCAddValueRate = GetConfig<byte>("Setup", "DressSCAddValueRate", M2Share.g_Config.nDressSCAddValueRate);
            M2Share.g_Config.nDressSCAddRate = GetConfig<byte>("Setup", "DressSCAddRate", M2Share.g_Config.nDressSCAddRate);
            M2Share.g_Config.nDressACAddValueMaxLimit = GetConfig<byte>("Setup", "DressACAddValueMaxLimit", M2Share.g_Config.nDressACAddValueMaxLimit);
            M2Share.g_Config.nDressACAddValueRate = GetConfig<byte>("Setup", "DressACAddValueRate", M2Share.g_Config.nDressACAddValueRate);
            M2Share.g_Config.nDressACAddRate = GetConfig<byte>("Setup", "DressACAddRate", M2Share.g_Config.nDressACAddRate);
            M2Share.g_Config.nDressMACAddValueMaxLimit = GetConfig<byte>("Setup", "DressMACAddValueMaxLimit", M2Share.g_Config.nDressMACAddValueMaxLimit);
            M2Share.g_Config.nDressMACAddValueRate = GetConfig<byte>("Setup", "DressMACAddValueRate", M2Share.g_Config.nDressMACAddValueRate);
            M2Share.g_Config.nDressMACAddRate = GetConfig<byte>("Setup", "DressMACAddRate", M2Share.g_Config.nDressMACAddRate);
            M2Share.g_Config.nNeckLace19DCAddValueMaxLimit = GetConfig<byte>("Setup", "NeckLace19DCAddValueMaxLimit", M2Share.g_Config.nNeckLace19DCAddValueMaxLimit);
            M2Share.g_Config.nNeckLace19DCAddValueRate = GetConfig<byte>("Setup", "NeckLace19DCAddValueRate", M2Share.g_Config.nNeckLace19DCAddValueRate);
            M2Share.g_Config.nNeckLace19DCAddRate = GetConfig<byte>("Setup", "NeckLace19DCAddRate", M2Share.g_Config.nNeckLace19DCAddRate);
            M2Share.g_Config.nNeckLace19MCAddValueMaxLimit = GetConfig<byte>("Setup", "NeckLace19MCAddValueMaxLimit", M2Share.g_Config.nNeckLace19MCAddValueMaxLimit);
            M2Share.g_Config.nNeckLace19MCAddValueRate = GetConfig<byte>("Setup", "NeckLace19MCAddValueRate", M2Share.g_Config.nNeckLace19MCAddValueRate);
            M2Share.g_Config.nNeckLace19MCAddRate = GetConfig<byte>("Setup", "NeckLace19MCAddRate", M2Share.g_Config.nNeckLace19MCAddRate);
            M2Share.g_Config.nNeckLace19SCAddValueMaxLimit = GetConfig<byte>("Setup", "NeckLace19SCAddValueMaxLimit", M2Share.g_Config.nNeckLace19SCAddValueMaxLimit);
            M2Share.g_Config.nNeckLace19SCAddValueRate = GetConfig<byte>("Setup", "NeckLace19SCAddValueRate", M2Share.g_Config.nNeckLace19SCAddValueRate);
            M2Share.g_Config.nNeckLace19SCAddRate = GetConfig<byte>("Setup", "NeckLace19SCAddRate", M2Share.g_Config.nNeckLace19SCAddRate);
            M2Share.g_Config.nNeckLace19ACAddValueMaxLimit = GetConfig<byte>("Setup", "NeckLace19ACAddValueMaxLimit", M2Share.g_Config.nNeckLace19ACAddValueMaxLimit);
            M2Share.g_Config.nNeckLace19ACAddValueRate = GetConfig<byte>("Setup", "NeckLace19ACAddValueRate", M2Share.g_Config.nNeckLace19ACAddValueRate);
            M2Share.g_Config.nNeckLace19ACAddRate = GetConfig<byte>("Setup", "NeckLace19ACAddRate", M2Share.g_Config.nNeckLace19ACAddRate);
            M2Share.g_Config.nNeckLace19MACAddValueMaxLimit = GetConfig<byte>("Setup", "NeckLace19MACAddValueMaxLimit", M2Share.g_Config.nNeckLace19MACAddValueMaxLimit);
            M2Share.g_Config.nNeckLace19MACAddValueRate = GetConfig<byte>("Setup", "NeckLace19MACAddValueRate", M2Share.g_Config.nNeckLace19MACAddValueRate);
            M2Share.g_Config.nNeckLace19MACAddRate = GetConfig<byte>("Setup", "NeckLace19MACAddRate", M2Share.g_Config.nNeckLace19MACAddRate);
            M2Share.g_Config.nNeckLace202124DCAddValueMaxLimit = GetConfig<byte>("Setup", "NeckLace202124DCAddValueMaxLimit", M2Share.g_Config.nNeckLace202124DCAddValueMaxLimit);
            M2Share.g_Config.nNeckLace202124DCAddValueRate = GetConfig<byte>("Setup", "NeckLace202124DCAddValueRate", M2Share.g_Config.nNeckLace202124DCAddValueRate);
            M2Share.g_Config.nNeckLace202124DCAddRate = GetConfig<byte>("Setup", "NeckLace202124DCAddRate", M2Share.g_Config.nNeckLace202124DCAddRate);
            M2Share.g_Config.nNeckLace202124MCAddValueMaxLimit = GetConfig<byte>("Setup", "NeckLace202124MCAddValueMaxLimit", M2Share.g_Config.nNeckLace202124MCAddValueMaxLimit);
            M2Share.g_Config.nNeckLace202124MCAddValueRate = GetConfig<byte>("Setup", "NeckLace202124MCAddValueRate", M2Share.g_Config.nNeckLace202124MCAddValueRate);
            M2Share.g_Config.nNeckLace202124MCAddRate = GetConfig<byte>("Setup", "NeckLace202124MCAddRate", M2Share.g_Config.nNeckLace202124MCAddRate);
            M2Share.g_Config.nNeckLace202124SCAddValueMaxLimit = GetConfig<byte>("Setup", "NeckLace202124SCAddValueMaxLimit", M2Share.g_Config.nNeckLace202124SCAddValueMaxLimit);
            M2Share.g_Config.nNeckLace202124SCAddValueRate = GetConfig<byte>("Setup", "NeckLace202124SCAddValueRate", M2Share.g_Config.nNeckLace202124SCAddValueRate);
            M2Share.g_Config.nNeckLace202124SCAddRate = GetConfig<byte>("Setup", "NeckLace202124SCAddRate", M2Share.g_Config.nNeckLace202124SCAddRate);
            M2Share.g_Config.nNeckLace202124ACAddValueMaxLimit = GetConfig<byte>("Setup", "NeckLace202124ACAddValueMaxLimit", M2Share.g_Config.nNeckLace202124ACAddValueMaxLimit);
            M2Share.g_Config.nNeckLace202124ACAddValueRate = GetConfig<byte>("Setup", "NeckLace202124ACAddValueRate", M2Share.g_Config.nNeckLace202124ACAddValueRate);
            M2Share.g_Config.nNeckLace202124ACAddRate = GetConfig<byte>("Setup", "NeckLace202124ACAddRate", M2Share.g_Config.nNeckLace202124ACAddRate);
            M2Share.g_Config.nNeckLace202124MACAddValueMaxLimit = GetConfig<byte>("Setup", "NeckLace202124MACAddValueMaxLimit", M2Share.g_Config.nNeckLace202124MACAddValueMaxLimit);
            M2Share.g_Config.nNeckLace202124MACAddValueRate = GetConfig<byte>("Setup", "NeckLace202124MACAddValueRate", M2Share.g_Config.nNeckLace202124MACAddValueRate);
            M2Share.g_Config.nNeckLace202124MACAddRate = GetConfig<byte>("Setup", "NeckLace202124MACAddRate", M2Share.g_Config.nNeckLace202124MACAddRate);
            M2Share.g_Config.nArmRing26DCAddValueMaxLimit = GetConfig<byte>("Setup", "ArmRing26DCAddValueMaxLimit", M2Share.g_Config.nArmRing26DCAddValueMaxLimit);
            M2Share.g_Config.nArmRing26DCAddValueRate = GetConfig<byte>("Setup", "ArmRing26DCAddValueRate", M2Share.g_Config.nArmRing26DCAddValueRate);
            M2Share.g_Config.nArmRing26DCAddRate = GetConfig<byte>("Setup", "ArmRing26DCAddRate", M2Share.g_Config.nArmRing26DCAddRate);
            M2Share.g_Config.nArmRing26MCAddValueMaxLimit = GetConfig<byte>("Setup", "ArmRing26MCAddValueMaxLimit", M2Share.g_Config.nArmRing26MCAddValueMaxLimit);
            M2Share.g_Config.nArmRing26MCAddValueRate = GetConfig<byte>("Setup", "ArmRing26MCAddValueRate", M2Share.g_Config.nArmRing26MCAddValueRate);
            M2Share.g_Config.nArmRing26MCAddRate = GetConfig<byte>("Setup", "ArmRing26MCAddRate", M2Share.g_Config.nArmRing26MCAddRate);
            M2Share.g_Config.nArmRing26SCAddValueMaxLimit = GetConfig<byte>("Setup", "ArmRing26SCAddValueMaxLimit", M2Share.g_Config.nArmRing26SCAddValueMaxLimit);
            M2Share.g_Config.nArmRing26SCAddValueRate = GetConfig<byte>("Setup", "ArmRing26SCAddValueRate", M2Share.g_Config.nArmRing26SCAddValueRate);
            M2Share.g_Config.nArmRing26SCAddRate = GetConfig<byte>("Setup", "ArmRing26SCAddRate", M2Share.g_Config.nArmRing26SCAddRate);
            M2Share.g_Config.nArmRing26ACAddValueMaxLimit = GetConfig<byte>("Setup", "ArmRing26ACAddValueMaxLimit", M2Share.g_Config.nArmRing26ACAddValueMaxLimit);
            M2Share.g_Config.nArmRing26ACAddValueRate = GetConfig<byte>("Setup", "ArmRing26ACAddValueRate", M2Share.g_Config.nArmRing26ACAddValueRate);
            M2Share.g_Config.nArmRing26ACAddRate = GetConfig<byte>("Setup", "ArmRing26ACAddRate", M2Share.g_Config.nArmRing26ACAddRate);
            M2Share.g_Config.nArmRing26MACAddValueMaxLimit = GetConfig<byte>("Setup", "ArmRing26MACAddValueMaxLimit", M2Share.g_Config.nArmRing26MACAddValueMaxLimit);
            M2Share.g_Config.nArmRing26MACAddValueRate = GetConfig<byte>("Setup", "ArmRing26MACAddValueRate", M2Share.g_Config.nArmRing26MACAddValueRate);
            M2Share.g_Config.nArmRing26MACAddRate = GetConfig<byte>("Setup", "ArmRing26MACAddRate", M2Share.g_Config.nArmRing26MACAddRate);
            M2Share.g_Config.nRing22DCAddValueMaxLimit = GetConfig<byte>("Setup", "Ring22DCAddValueMaxLimit", M2Share.g_Config.nRing22DCAddValueMaxLimit);
            M2Share.g_Config.nRing22DCAddValueRate = GetConfig<byte>("Setup", "Ring22DCAddValueRate", M2Share.g_Config.nRing22DCAddValueRate);
            M2Share.g_Config.nRing22DCAddRate = GetConfig<byte>("Setup", "Ring22DCAddRate", M2Share.g_Config.nRing22DCAddRate);
            M2Share.g_Config.nRing22MCAddValueMaxLimit = GetConfig<byte>("Setup", "Ring22MCAddValueMaxLimit", M2Share.g_Config.nRing22MCAddValueMaxLimit);
            M2Share.g_Config.nRing22MCAddValueRate = GetConfig<byte>("Setup", "Ring22MCAddValueRate", M2Share.g_Config.nRing22MCAddValueRate);
            M2Share.g_Config.nRing22MCAddRate = GetConfig<byte>("Setup", "Ring22MCAddRate", M2Share.g_Config.nRing22MCAddRate);
            M2Share.g_Config.nRing22SCAddValueMaxLimit = GetConfig<byte>("Setup", "Ring22SCAddValueMaxLimit", M2Share.g_Config.nRing22SCAddValueMaxLimit);
            M2Share.g_Config.nRing22SCAddValueRate = GetConfig<byte>("Setup", "Ring22SCAddValueRate", M2Share.g_Config.nRing22SCAddValueRate);
            M2Share.g_Config.nRing22SCAddRate = GetConfig<byte>("Setup", "Ring22SCAddRate", M2Share.g_Config.nRing22SCAddRate);
            M2Share.g_Config.nRing23DCAddValueMaxLimit = GetConfig<byte>("Setup", "Ring23DCAddValueMaxLimit", M2Share.g_Config.nRing23DCAddValueMaxLimit);
            M2Share.g_Config.nRing23DCAddValueRate = GetConfig<byte>("Setup", "Ring23DCAddValueRate", M2Share.g_Config.nRing23DCAddValueRate);
            M2Share.g_Config.nRing23DCAddRate = GetConfig<byte>("Setup", "Ring23DCAddRate", M2Share.g_Config.nRing23DCAddRate);
            M2Share.g_Config.nRing23MCAddValueMaxLimit = GetConfig<byte>("Setup", "Ring23MCAddValueMaxLimit", M2Share.g_Config.nRing23MCAddValueMaxLimit);
            M2Share.g_Config.nRing23MCAddValueRate = GetConfig<byte>("Setup", "Ring23MCAddValueRate", M2Share.g_Config.nRing23MCAddValueRate);
            M2Share.g_Config.nRing23MCAddRate = GetConfig<byte>("Setup", "Ring23MCAddRate", M2Share.g_Config.nRing23MCAddRate);
            M2Share.g_Config.nRing23SCAddValueMaxLimit = GetConfig<byte>("Setup", "Ring23SCAddValueMaxLimit", M2Share.g_Config.nRing23SCAddValueMaxLimit);
            M2Share.g_Config.nRing23SCAddValueRate = GetConfig<byte>("Setup", "Ring23SCAddValueRate", M2Share.g_Config.nRing23SCAddValueRate);
            M2Share.g_Config.nRing23SCAddRate = GetConfig<byte>("Setup", "Ring23SCAddRate", M2Share.g_Config.nRing23SCAddRate);
            M2Share.g_Config.nRing23ACAddValueMaxLimit = GetConfig<byte>("Setup", "Ring23ACAddValueMaxLimit", M2Share.g_Config.nRing23ACAddValueMaxLimit);
            M2Share.g_Config.nRing23ACAddValueRate = GetConfig<byte>("Setup", "Ring23ACAddValueRate", M2Share.g_Config.nRing23ACAddValueRate);
            M2Share.g_Config.nRing23ACAddRate = GetConfig<byte>("Setup", "Ring23ACAddRate", M2Share.g_Config.nRing23ACAddRate);
            M2Share.g_Config.nRing23MACAddValueMaxLimit = GetConfig<byte>("Setup", "Ring23MACAddValueMaxLimit", M2Share.g_Config.nRing23MACAddValueMaxLimit);
            M2Share.g_Config.nRing23MACAddValueRate = GetConfig<byte>("Setup", "Ring23MACAddValueRate", M2Share.g_Config.nRing23MACAddValueRate);
            M2Share.g_Config.nRing23MACAddRate = GetConfig<byte>("Setup", "Ring23MACAddRate", M2Share.g_Config.nRing23MACAddRate);
            // ------------------------------------------------------------------------------
            // 20080503 极品鞋子加攻最高点
            M2Share.g_Config.nBootsDCAddValueMaxLimit = GetConfig<byte>("Setup", "BootsDCAddValueMaxLimit", M2Share.g_Config.nBootsDCAddValueMaxLimit);
            M2Share.g_Config.nBootsDCAddValueRate = GetConfig<byte>("Setup", "BootsDCAddValueRate", M2Share.g_Config.nBootsDCAddValueRate);
            M2Share.g_Config.nBootsDCAddRate = GetConfig<byte>("Setup", "BootsDCAddRate", M2Share.g_Config.nBootsDCAddRate);
            // 道术
            M2Share.g_Config.nBootsSCAddValueMaxLimit = GetConfig<byte>("Setup", "BootsSCAddValueMaxLimit", M2Share.g_Config.nBootsSCAddValueMaxLimit);
            M2Share.g_Config.nBootsSCAddValueRate = GetConfig<byte>("Setup", "BootsSCAddValueRate", M2Share.g_Config.nBootsSCAddValueRate);
            M2Share.g_Config.nBootsSCAddRate = GetConfig<byte>("Setup", "BootsSCAddRate", M2Share.g_Config.nBootsSCAddRate);
            // 魔法
            M2Share.g_Config.nBootsMCAddValueMaxLimit = GetConfig<byte>("Setup", "BootsMCAddValueMaxLimit", M2Share.g_Config.nBootsMCAddValueMaxLimit);
            M2Share.g_Config.nBootsMCAddValueRate = GetConfig<byte>("Setup", "BootsMCAddValueRate", M2Share.g_Config.nBootsMCAddValueRate);
            M2Share.g_Config.nBootsMCAddRate = GetConfig<byte>("Setup", "BootsMCAddRate", M2Share.g_Config.nBootsMCAddRate);
            // 防御
            M2Share.g_Config.nBootsACAddValueMaxLimit = GetConfig<byte>("Setup", "BootsACAddValueMaxLimit", M2Share.g_Config.nBootsACAddValueMaxLimit);
            M2Share.g_Config.nBootsACAddValueRate = GetConfig<byte>("Setup", "BootsACAddValueRate", M2Share.g_Config.nBootsACAddValueRate);
            M2Share.g_Config.nBootsACAddRate = GetConfig<byte>("Setup", "BootsACAddRate", M2Share.g_Config.nBootsACAddRate);
            // 魔御
            M2Share.g_Config.nBootsMACAddValueMaxLimit = GetConfig<byte>("Setup", "BootsMACAddValueMaxLimit", M2Share.g_Config.nBootsMACAddValueMaxLimit);
            M2Share.g_Config.nBootsMACAddValueRate = GetConfig<byte>("Setup", "BootsMACAddValueRate", M2Share.g_Config.nBootsMACAddValueRate);
            M2Share.g_Config.nBootsMACAddRate = GetConfig<byte>("Setup", "BootsMACAddRate", M2Share.g_Config.nBootsMACAddRate);
            // ------------------------------------------------------------------------------
            M2Share.g_Config.nHelMetDCAddValueMaxLimit = GetConfig<byte>("Setup", "HelMetDCAddValueMaxLimit", M2Share.g_Config.nHelMetDCAddValueMaxLimit);
            M2Share.g_Config.nHelMetDCAddValueRate = GetConfig<byte>("Setup", "HelMetDCAddValueRate", M2Share.g_Config.nHelMetDCAddValueRate);
            M2Share.g_Config.nHelMetDCAddRate = GetConfig<byte>("Setup", "HelMetDCAddRate", M2Share.g_Config.nHelMetDCAddRate);
            M2Share.g_Config.nHelMetMCAddValueMaxLimit = GetConfig<byte>("Setup", "HelMetMCAddValueMaxLimit", M2Share.g_Config.nHelMetMCAddValueMaxLimit);
            M2Share.g_Config.nHelMetMCAddValueRate = GetConfig<byte>("Setup", "HelMetMCAddValueRate", M2Share.g_Config.nHelMetMCAddValueRate);
            M2Share.g_Config.nHelMetMCAddRate = GetConfig<byte>("Setup", "HelMetMCAddRate", M2Share.g_Config.nHelMetMCAddRate);
            M2Share.g_Config.nHelMetSCAddValueMaxLimit = GetConfig<byte>("Setup", "HelMetSCAddValueMaxLimit", M2Share.g_Config.nHelMetSCAddValueMaxLimit);
            M2Share.g_Config.nHelMetSCAddValueRate = GetConfig<byte>("Setup", "HelMetSCAddValueRate", M2Share.g_Config.nHelMetSCAddValueRate);
            M2Share.g_Config.nHelMetSCAddRate = GetConfig<byte>("Setup", "HelMetSCAddRate", M2Share.g_Config.nHelMetSCAddRate);
            M2Share.g_Config.nHelMetACAddValueMaxLimit = GetConfig<byte>("Setup", "HelMetACAddValueMaxLimit", M2Share.g_Config.nHelMetACAddValueMaxLimit);
            M2Share.g_Config.nHelMetACAddValueRate = GetConfig<byte>("Setup", "HelMetACAddValueRate", M2Share.g_Config.nHelMetACAddValueRate);
            M2Share.g_Config.nHelMetACAddRate = GetConfig<byte>("Setup", "HelMetACAddRate", M2Share.g_Config.nHelMetACAddRate);
            M2Share.g_Config.nHelMetMACAddValueMaxLimit = GetConfig<byte>("Setup", "HelMetMACAddValueMaxLimit", M2Share.g_Config.nHelMetMACAddValueMaxLimit);
            M2Share.g_Config.nHelMetMACAddValueRate = GetConfig<byte>("Setup", "HelMetMACAddValueRate", M2Share.g_Config.nHelMetMACAddValueRate);
            M2Share.g_Config.nHelMetMACAddRate = GetConfig<byte>("Setup", "HelMetMACAddRate", M2Share.g_Config.nHelMetMACAddRate);
            M2Share.g_Config.nUnknowHelMetACAddRate = GetConfig<byte>("Setup", "UnknowHelMetACAddRate", M2Share.g_Config.nUnknowHelMetACAddRate);
            M2Share.g_Config.nUnknowHelMetACAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowHelMetACAddValueMaxLimit", M2Share.g_Config.nUnknowHelMetACAddValueMaxLimit);
            M2Share.g_Config.nUnknowHelMetMACAddRate = GetConfig<byte>("Setup", "UnknowHelMetMACAddRate", M2Share.g_Config.nUnknowHelMetMACAddRate);
            M2Share.g_Config.nUnknowHelMetMACAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowHelMetMACAddValueMaxLimit", M2Share.g_Config.nUnknowHelMetMACAddValueMaxLimit);
            M2Share.g_Config.nUnknowHelMetDCAddRate = GetConfig<byte>("Setup", "UnknowHelMetDCAddRate", M2Share.g_Config.nUnknowHelMetDCAddRate);
            M2Share.g_Config.nUnknowHelMetDCAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowHelMetDCAddValueMaxLimit", M2Share.g_Config.nUnknowHelMetDCAddValueMaxLimit);
            M2Share.g_Config.nUnknowHelMetMCAddRate = GetConfig<byte>("Setup", "UnknowHelMetMCAddRate", M2Share.g_Config.nUnknowHelMetMCAddRate);
            M2Share.g_Config.nUnknowHelMetMCAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowHelMetMCAddValueMaxLimit", M2Share.g_Config.nUnknowHelMetMCAddValueMaxLimit);
            M2Share.g_Config.nUnknowHelMetSCAddRate = GetConfig<byte>("Setup", "UnknowHelMetSCAddRate", M2Share.g_Config.nUnknowHelMetSCAddRate);
            M2Share.g_Config.nUnknowHelMetSCAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowHelMetSCAddValueMaxLimit", M2Share.g_Config.nUnknowHelMetSCAddValueMaxLimit);
            M2Share.g_Config.nUnknowNecklaceACAddRate = GetConfig<byte>("Setup", "UnknowNecklaceACAddRate", M2Share.g_Config.nUnknowNecklaceACAddRate);
            M2Share.g_Config.nUnknowNecklaceACAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowNecklaceACAddValueMaxLimit", M2Share.g_Config.nUnknowNecklaceACAddValueMaxLimit);
            M2Share.g_Config.nUnknowNecklaceMACAddRate = GetConfig<byte>("Setup", "UnknowNecklaceMACAddRate", M2Share.g_Config.nUnknowNecklaceMACAddRate);
            M2Share.g_Config.nUnknowNecklaceMACAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowNecklaceMACAddValueMaxLimit", M2Share.g_Config.nUnknowNecklaceMACAddValueMaxLimit);
            M2Share.g_Config.nUnknowNecklaceDCAddRate = GetConfig<byte>("Setup", "UnknowNecklaceDCAddRate", M2Share.g_Config.nUnknowNecklaceDCAddRate);
            M2Share.g_Config.nUnknowNecklaceDCAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowNecklaceDCAddValueMaxLimit", M2Share.g_Config.nUnknowNecklaceDCAddValueMaxLimit);
            M2Share.g_Config.nUnknowNecklaceMCAddRate = GetConfig<byte>("Setup", "UnknowNecklaceMCAddRate", M2Share.g_Config.nUnknowNecklaceMCAddRate);
            M2Share.g_Config.nUnknowNecklaceMCAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowNecklaceMCAddValueMaxLimit", M2Share.g_Config.nUnknowNecklaceMCAddValueMaxLimit);
            M2Share.g_Config.nUnknowNecklaceSCAddRate = GetConfig<byte>("Setup", "UnknowNecklaceSCAddRate", M2Share.g_Config.nUnknowNecklaceSCAddRate);
            M2Share.g_Config.nUnknowNecklaceSCAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowNecklaceSCAddValueMaxLimit", M2Share.g_Config.nUnknowNecklaceSCAddValueMaxLimit);
            M2Share.g_Config.nUnknowRingACAddRate = GetConfig<byte>("Setup", "UnknowRingACAddRate", M2Share.g_Config.nUnknowRingACAddRate);
            M2Share.g_Config.nUnknowRingACAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowRingACAddValueMaxLimit", M2Share.g_Config.nUnknowRingACAddValueMaxLimit);
            M2Share.g_Config.nUnknowRingMACAddRate = GetConfig<byte>("Setup", "UnknowRingMACAddRate", M2Share.g_Config.nUnknowRingMACAddRate);
            M2Share.g_Config.nUnknowRingMACAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowRingMACAddValueMaxLimit", M2Share.g_Config.nUnknowRingMACAddValueMaxLimit);
            M2Share.g_Config.nUnknowRingDCAddRate = GetConfig<byte>("Setup", "UnknowRingDCAddRate", M2Share.g_Config.nUnknowRingDCAddRate);
            M2Share.g_Config.nUnknowRingDCAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowRingDCAddValueMaxLimit", M2Share.g_Config.nUnknowRingDCAddValueMaxLimit);
            M2Share.g_Config.nUnknowRingMCAddRate = GetConfig<byte>("Setup", "UnknowRingMCAddRate", M2Share.g_Config.nUnknowRingMCAddRate);
            M2Share.g_Config.nUnknowRingMCAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowRingMCAddValueMaxLimit", M2Share.g_Config.nUnknowRingMCAddValueMaxLimit);
            M2Share.g_Config.nUnknowRingSCAddRate = GetConfig<byte>("Setup", "UnknowRingSCAddRate", M2Share.g_Config.nUnknowRingSCAddRate);
            M2Share.g_Config.nUnknowRingSCAddValueMaxLimit = GetConfig<byte>("Setup", "UnknowRingSCAddValueMaxLimit", M2Share.g_Config.nUnknowRingSCAddValueMaxLimit);
            M2Share.g_Config.nMonOneDropGoldCount = GetConfig<int>("Setup", "MonOneDropGoldCount", M2Share.g_Config.nMonOneDropGoldCount);
            M2Share.g_Config.nMakeMineHitRate = GetConfig<ushort>("Setup", "MakeMineHitRate", M2Share.g_Config.nMakeMineHitRate);
            M2Share.g_Config.nMakeMineRate = GetConfig<ushort>("Setup", "MakeMineRate", M2Share.g_Config.nMakeMineRate);
            M2Share.g_Config.nStoneTypeRate = GetConfig<ushort>("Setup", "StoneTypeRate", M2Share.g_Config.nStoneTypeRate);
            M2Share.g_Config.nStoneTypeRateMin = GetConfig<ushort>("Setup", "StoneTypeRateMin", M2Share.g_Config.nStoneTypeRateMin);
            M2Share.g_Config.nGoldStoneMin = GetConfig<ushort>("Setup", "GoldStoneMin", M2Share.g_Config.nGoldStoneMin);
            M2Share.g_Config.nGoldStoneMax = GetConfig<ushort>("Setup", "GoldStoneMax", M2Share.g_Config.nGoldStoneMax);
            M2Share.g_Config.nSilverStoneMin = GetConfig<ushort>("Setup", "SilverStoneMin", M2Share.g_Config.nSilverStoneMin);
            M2Share.g_Config.nSilverStoneMax = GetConfig<ushort>("Setup", "SilverStoneMax", M2Share.g_Config.nSilverStoneMax);
            M2Share.g_Config.nSteelStoneMin = GetConfig<ushort>("Setup", "SteelStoneMin", M2Share.g_Config.nSteelStoneMin);
            M2Share.g_Config.nSteelStoneMax = GetConfig<ushort>("Setup", "SteelStoneMax", M2Share.g_Config.nSteelStoneMax);
            M2Share.g_Config.nBlackStoneMin = GetConfig<ushort>("Setup", "BlackStoneMin", M2Share.g_Config.nBlackStoneMin);
            M2Share.g_Config.nBlackStoneMax = GetConfig<ushort>("Setup", "BlackStoneMax", M2Share.g_Config.nBlackStoneMax);
            M2Share.g_Config.nStoneMinDura = GetConfig<ushort>("Setup", "StoneMinDura", M2Share.g_Config.nStoneMinDura);
            M2Share.g_Config.nStoneGeneralDuraRate = GetConfig<ushort>("Setup", "StoneGeneralDuraRate", M2Share.g_Config.nStoneGeneralDuraRate);
            M2Share.g_Config.nStoneAddDuraRate = GetConfig<ushort>("Setup", "StoneAddDuraRate", M2Share.g_Config.nStoneAddDuraRate);
            M2Share.g_Config.nStoneAddDuraMax = GetConfig<ushort>("Setup", "StoneAddDuraMax", M2Share.g_Config.nStoneAddDuraMax);
            M2Share.g_Config.nWinLottery1Min = GetConfig<int>("Setup", "WinLottery1Min", M2Share.g_Config.nWinLottery1Min);
            M2Share.g_Config.nWinLottery1Max = GetConfig<int>("Setup", "WinLottery1Max", M2Share.g_Config.nWinLottery1Max);
            M2Share.g_Config.nWinLottery2Min = GetConfig<int>("Setup", "WinLottery2Min", M2Share.g_Config.nWinLottery2Min);
            M2Share.g_Config.nWinLottery2Max = GetConfig<int>("Setup", "WinLottery2Max", M2Share.g_Config.nWinLottery2Max);
            M2Share.g_Config.nWinLottery3Min = GetConfig<int>("Setup", "WinLottery3Min", M2Share.g_Config.nWinLottery3Min);
            M2Share.g_Config.nWinLottery3Max = GetConfig<int>("Setup", "WinLottery3Max", M2Share.g_Config.nWinLottery3Max);
            M2Share.g_Config.nWinLottery4Min = GetConfig<int>("Setup", "WinLottery4Min", M2Share.g_Config.nWinLottery4Min);
            M2Share.g_Config.nWinLottery4Max = GetConfig<int>("Setup", "WinLottery4Max", M2Share.g_Config.nWinLottery4Max);
            M2Share.g_Config.nWinLottery5Min = GetConfig<int>("Setup", "WinLottery5Min", M2Share.g_Config.nWinLottery5Min);
            M2Share.g_Config.nWinLottery5Max = GetConfig<int>("Setup", "WinLottery5Max", M2Share.g_Config.nWinLottery5Max);
            M2Share.g_Config.nWinLottery6Min = GetConfig<int>("Setup", "WinLottery6Min", M2Share.g_Config.nWinLottery6Min);
            M2Share.g_Config.nWinLottery6Max = GetConfig<int>("Setup", "WinLottery6Max", M2Share.g_Config.nWinLottery6Max);
            M2Share.g_Config.nWinLotteryRate = GetConfig<int>("Setup", "WinLotteryRate", M2Share.g_Config.nWinLotteryRate);
            M2Share.g_Config.nWinLottery1Gold = GetConfig<int>("Setup", "WinLottery1Gold", M2Share.g_Config.nWinLottery1Gold);
            M2Share.g_Config.nWinLottery2Gold = GetConfig<int>("Setup", "WinLottery2Gold", M2Share.g_Config.nWinLottery2Gold);
            M2Share.g_Config.nWinLottery3Gold = GetConfig<int>("Setup", "WinLottery3Gold", M2Share.g_Config.nWinLottery3Gold);
            M2Share.g_Config.nWinLottery4Gold = GetConfig<int>("Setup", "WinLottery4Gold", M2Share.g_Config.nWinLottery4Gold);
            M2Share.g_Config.nWinLottery5Gold = GetConfig<int>("Setup", "WinLottery5Gold", M2Share.g_Config.nWinLottery5Gold);
            M2Share.g_Config.nWinLottery6Gold = GetConfig<int>("Setup", "WinLottery6Gold", M2Share.g_Config.nWinLottery6Gold);
            M2Share.g_Config.nGuildRecallTime = GetConfig<ushort>("Setup", "GuildRecallTime", M2Share.g_Config.nGuildRecallTime);
            M2Share.g_Config.nGroupRecallTime = GetConfig<ushort>("Setup", "GroupRecallTime", M2Share.g_Config.nGroupRecallTime);
            M2Share.g_Config.boControlDropItem = GetConfig<bool>("Setup", "ControlDropItem", M2Share.g_Config.boControlDropItem);
            M2Share.g_Config.boInSafeDisableDrop = GetConfig<bool>("Setup", "InSafeDisableDrop", M2Share.g_Config.boInSafeDisableDrop);
            M2Share.g_Config.nCanDropGold = GetConfig<int>("Setup", "CanDropGold", M2Share.g_Config.nCanDropGold);
            M2Share.g_Config.nCanDropPrice = GetConfig<int>("Setup", "CanDropPrice", M2Share.g_Config.nCanDropPrice);
            M2Share.g_Config.boSendCustemMsg = GetConfig<bool>("Setup", "SendCustemMsg", M2Share.g_Config.boSendCustemMsg);
            M2Share.g_Config.boSubkMasterSendMsg = GetConfig<bool>("Setup", "SubkMasterSendMsg", M2Share.g_Config.boSubkMasterSendMsg);
            M2Share.g_Config.nSuperRepairPriceRate = GetConfig<byte>("Setup", "SuperRepairPriceRate", M2Share.g_Config.nSuperRepairPriceRate);
            M2Share.g_Config.nRepairItemDecDura = GetConfig<byte>("Setup", "RepairItemDecDura", M2Share.g_Config.nRepairItemDecDura);
            M2Share.g_Config.boDieScatterBag = GetConfig<bool>("Setup", "DieScatterBag", M2Share.g_Config.boDieScatterBag);
            M2Share.g_Config.nDieScatterBagRate = GetConfig<byte>("Setup", "DieScatterBagRate", M2Share.g_Config.nDieScatterBagRate);
            M2Share.g_Config.boDieRedScatterBagAll = GetConfig<bool>("Setup", "DieRedScatterBagAll", M2Share.g_Config.boDieRedScatterBagAll);
            M2Share.g_Config.nDieDropUseItemRate = GetConfig<byte>("Setup", "DieDropUseItemRate", M2Share.g_Config.nDieDropUseItemRate);
            M2Share.g_Config.nDieRedDropUseItemRate = GetConfig<byte>("Setup", "DieRedDropUseItemRate", M2Share.g_Config.nDieRedDropUseItemRate);
            M2Share.g_Config.boDieDropGold = GetConfig<bool>("Setup", "DieDropGold", M2Share.g_Config.boDieDropGold);
            M2Share.g_Config.boKillByHumanDropUseItem = GetConfig<bool>("Setup", "KillByHumanDropUseItem", M2Share.g_Config.boKillByHumanDropUseItem);
            M2Share.g_Config.boKillByMonstDropUseItem = GetConfig<bool>("Setup", "KillByMonstDropUseItem", M2Share.g_Config.boKillByMonstDropUseItem);
            M2Share.g_Config.boKickExpireHuman = GetConfig<bool>("Setup", "KickExpireHuman", M2Share.g_Config.boKickExpireHuman);
            M2Share.g_Config.nGuildRankNameLen = GetConfig<ushort>("Setup", "GuildRankNameLen", M2Share.g_Config.nGuildRankNameLen);
            M2Share.g_Config.nGuildNameLen = GetConfig<ushort>("Setup", "GuildNameLen", M2Share.g_Config.nGuildNameLen);
            M2Share.g_Config.nGuildMemberMaxLimit = GetConfig<ushort>("Setup", "GuildMemberMaxLimit", M2Share.g_Config.nGuildMemberMaxLimit);
            M2Share.g_Config.nAttackPosionRate = GetConfig<byte>("Setup", "AttackPosionRate", M2Share.g_Config.nAttackPosionRate);
            M2Share.g_Config.nAttackPosionTime = GetConfig<byte>("Setup", "AttackPosionTime", M2Share.g_Config.nAttackPosionTime);
            M2Share.g_Config.dwRevivalTime = GetConfig<uint>("Setup", "RevivalTime", M2Share.g_Config.dwRevivalTime);
            M2Share.g_Config.boUserMoveCanDupObj = GetConfig<bool>("Setup", "UserMoveCanDupObj", M2Share.g_Config.boUserMoveCanDupObj);
            M2Share.g_Config.boUserMoveCanOnItem = GetConfig<bool>("Setup", "UserMoveCanOnItem", M2Share.g_Config.boUserMoveCanOnItem);
            M2Share.g_Config.dwUserMoveTime = GetConfig<byte>("Setup", "UserMoveTime", M2Share.g_Config.dwUserMoveTime);
            M2Share.g_Config.dwPKDieLostExpRate = GetConfig<uint>("Setup", "PKDieLostExpRate", M2Share.g_Config.dwPKDieLostExpRate);
            M2Share.g_Config.nPKDieLostLevelRate = GetConfig<int>("Setup", "PKDieLostLevelRate", M2Share.g_Config.nPKDieLostLevelRate);
            M2Share.g_Config.nChallengeTime = GetConfig<ushort>("Setup", "ChallengeTime", M2Share.g_Config.nChallengeTime); // 挑战时间 20080706
            M2Share.g_Config.btNPCNameColor = GetConfig<byte>("Setup", "NPCNameColor", M2Share.g_Config.btNPCNameColor); // NPC名字颜色 20081218
            M2Share.g_Config.btPKFlagNameColor = GetConfig<byte>("Setup", "PKFlagNameColor", M2Share.g_Config.btPKFlagNameColor);
            M2Share.g_Config.btAllyAndGuildNameColor = GetConfig<byte>("Setup", "AllyAndGuildNameColor", M2Share.g_Config.btAllyAndGuildNameColor);
            M2Share.g_Config.btWarGuildNameColor = GetConfig<byte>("Setup", "WarGuildNameColor", M2Share.g_Config.btWarGuildNameColor);
            M2Share.g_Config.btInFreePKAreaNameColor = GetConfig<byte>("Setup", "InFreePKAreaNameColor", M2Share.g_Config.btInFreePKAreaNameColor);
            M2Share.g_Config.btPKLevel1NameColor = GetConfig<byte>("Setup", "PKLevel1NameColor", M2Share.g_Config.btPKLevel1NameColor);
            M2Share.g_Config.btPKLevel2NameColor = GetConfig<byte>("Setup", "PKLevel2NameColor", M2Share.g_Config.btPKLevel2NameColor);
            M2Share.g_Config.boSpiritMutiny = GetConfig<bool>("Setup", "SpiritMutiny", M2Share.g_Config.boSpiritMutiny);
            M2Share.g_Config.dwSpiritMutinyTime = GetConfig<uint>("Setup", "SpiritMutinyTime", M2Share.g_Config.dwSpiritMutinyTime);
            M2Share.g_Config.boMasterDieMutiny = GetConfig<bool>("Setup", "MasterDieMutiny", M2Share.g_Config.boMasterDieMutiny);
            M2Share.g_Config.nMasterDieMutinyRate = GetConfig<ushort>("Setup", "MasterDieMutinyRate", M2Share.g_Config.nMasterDieMutinyRate);
            M2Share.g_Config.nMasterDieMutinyPower = GetConfig<ushort>("Setup", "MasterDieMutinyPower", M2Share.g_Config.nMasterDieMutinyPower);
            M2Share.g_Config.nMasterDieMutinySpeed = GetConfig<ushort>("Setup", "MasterDieMutinyPower", M2Share.g_Config.nMasterDieMutinySpeed);
            M2Share.g_Config.boBBMonAutoChangeColor = GetConfig<bool>("Setup", "BBMonAutoChangeColor", M2Share.g_Config.boBBMonAutoChangeColor);
            M2Share.g_Config.dwBBMonAutoChangeColorTime = GetConfig<int>("Setup", "BBMonAutoChangeColorTime", M2Share.g_Config.dwBBMonAutoChangeColorTime);
            M2Share.g_Config.boOldClientShowHiLevel = GetConfig<bool>("Setup", "OldClientShowHiLevel", M2Share.g_Config.boOldClientShowHiLevel);
            M2Share.g_Config.boShowScriptActionMsg = GetConfig<bool>("Setup", "ShowScriptActionMsg", M2Share.g_Config.boShowScriptActionMsg);
            M2Share.g_Config.boThreadRun = GetConfig<bool>("Setup", "ThreadRun", M2Share.g_Config.boThreadRun);
            M2Share.g_Config.ClientConf.btDieColor = GetConfig<byte>("Setup", "DeathColorEffect", M2Share.g_Config.ClientConf.btDieColor);
            M2Share.g_Config.ClientConf.boParalyCanRun = GetConfig<bool>("Setup", "ParalyCanRun", M2Share.g_Config.ClientConf.boParalyCanRun);
            M2Share.g_Config.ClientConf.boParalyCanWalk = GetConfig<bool>("Setup", "ParalyCanWalk", M2Share.g_Config.ClientConf.boParalyCanWalk);
            M2Share.g_Config.ClientConf.boParalyCanHit = GetConfig<bool>("Setup", "ParalyCanHit", M2Share.g_Config.ClientConf.boParalyCanHit);
            M2Share.g_Config.ClientConf.boParalyCanSpell = GetConfig<bool>("Setup", "ParalyCanSpell", M2Share.g_Config.ClientConf.boParalyCanSpell);
            M2Share.g_Config.boShowExceptionMsg = GetConfig<bool>("Setup", "ShowExceptionMsg", M2Share.g_Config.boShowExceptionMsg);
            M2Share.g_Config.boShowPreFixMsg = GetConfig<bool>("Setup", "ShowPreFixMsg", M2Share.g_Config.boShowPreFixMsg);
            M2Share.g_Config.boGMShowFailMsg = GetConfig<bool>("Setup", "GMShowFailMsg", M2Share.g_Config.boGMShowFailMsg);// GM命令错误是否提示 20080602
            M2Share.g_Config.boRecordClientMsg = GetConfig<bool>("Setup", "RecordClientMsg", M2Share.g_Config.boRecordClientMsg); // 记录人物私聊，行会聊天信息 20081213
            M2Share.g_Config.nMagTurnUndeadLevel = GetConfig<ushort>("Setup", "MagTurnUndeadLevel", M2Share.g_Config.nMagTurnUndeadLevel);
            M2Share.g_Config.nMagTammingLevel = GetConfig<ushort>("Setup", "MagTammingLevel", M2Share.g_Config.nMagTammingLevel);
            M2Share.g_Config.nMagTammingTargetLevel = GetConfig<ushort>("Setup", "MagTammingTargetLevel", M2Share.g_Config.nMagTammingTargetLevel);
            M2Share.g_Config.nMagTammingHPRate = GetConfig<ushort>("Setup", "MagTammingTargetHPRate", M2Share.g_Config.nMagTammingHPRate);
            M2Share.g_Config.nMagTammingCount = GetConfig<byte>("Setup", "MagTammingCount", M2Share.g_Config.nMagTammingCount);
            M2Share.g_Config.nMabMabeHitRandRate = GetConfig<byte>("Setup", "MabMabeHitRandRate", M2Share.g_Config.nMabMabeHitRandRate);
            M2Share.g_Config.nMabMabeHitMinLvLimit = GetConfig<byte>("Setup", "MabMabeHitMinLvLimit", M2Share.g_Config.nMabMabeHitMinLvLimit);
            M2Share.g_Config.nMabMabeHitSucessRate = GetConfig<byte>("Setup", "MabMabeHitSucessRate", M2Share.g_Config.nMabMabeHitSucessRate);
            M2Share.g_Config.nMabMabeHitMabeTimeRate = GetConfig<byte>("Setup", "MabMabeHitMabeTimeRate", M2Share.g_Config.nMabMabeHitMabeTimeRate);
            M2Share.g_Config.nMagicAttackRage = GetConfig<byte>("Setup", "MagicAttackRage", M2Share.g_Config.nMagicAttackRage);
            M2Share.g_Config.nAmyOunsulPoint = GetConfig<byte>("Setup", "AmyOunsulPoint", M2Share.g_Config.nAmyOunsulPoint);
            M2Share.g_Config.boDisableInSafeZoneFireCross = GetConfig<bool>("Setup", "DisableInSafeZoneFireCross", M2Share.g_Config.boDisableInSafeZoneFireCross);
            M2Share.g_Config.boGroupMbAttackPlayObject = GetConfig<bool>("Setup", "GroupMbAttackPlayObject", M2Share.g_Config.boGroupMbAttackPlayObject);
            M2Share.g_Config.dwPosionDecHealthTime = GetConfig<uint>("Setup", "PosionDecHealthTime", M2Share.g_Config.dwPosionDecHealthTime);
            M2Share.g_Config.nPosionDamagarmor = GetConfig<ushort>("Setup", "PosionDamagarmor", M2Share.g_Config.nPosionDamagarmor);
            M2Share.g_Config.boLimitSwordLong = GetConfig<bool>("Setup", "LimitSwordLong", M2Share.g_Config.boLimitSwordLong);
            M2Share.g_Config.nSwordLongPowerRate = GetConfig<ushort>("Setup", "SwordLongPowerRate", M2Share.g_Config.nSwordLongPowerRate);
            M2Share.g_Config.nFireBoomRage = GetConfig<byte>("Setup", "FireBoomRage", M2Share.g_Config.nFireBoomRage);
            M2Share.g_Config.nSnowWindRange = GetConfig<byte>("Setup", "SnowWindRange", M2Share.g_Config.nSnowWindRange);
            M2Share.g_Config.nMeteorFireRainRage = GetConfig<byte>("Setup", "MeteorFireRainRage", M2Share.g_Config.nMeteorFireRainRage);// 流星火雨攻击范围 20080510
            M2Share.g_Config.nMagFireCharmTreatment = GetConfig<byte>("Setup", "MagFireCharmTreatment", M2Share.g_Config.nMagFireCharmTreatment);// 噬血术加血百分率 20080511
            M2Share.g_Config.nElecBlizzardRange = GetConfig<byte>("Setup", "ElecBlizzardRange", M2Share.g_Config.nElecBlizzardRange);
            //M2Share.g_Config.nHumanLevelD
            M2Share.g_Config.boKillHumanWinLevel = GetConfig<bool>("Setup", "KillHumanWinLevel", M2Share.g_Config.boKillHumanWinLevel);
            M2Share.g_Config.boKilledLostLevel = GetConfig<bool>("Setup", "KilledLostLevel", M2Share.g_Config.boKilledLostLevel);
            M2Share.g_Config.nKillHumanWinLevel = GetConfig<ushort>("Setup", "KillHumanWinLevelPoint", M2Share.g_Config.nKillHumanWinLevel);
            M2Share.g_Config.nKilledLostLevel = GetConfig<ushort>("Setup", "KilledLostLevelPoint", M2Share.g_Config.nKilledLostLevel);
            M2Share.g_Config.boKillHumanWinExp = GetConfig<bool>("Setup", "KillHumanWinExp", M2Share.g_Config.boKillHumanWinExp);
            M2Share.g_Config.boKilledLostExp = GetConfig<bool>("Setup", "KilledLostExp", M2Share.g_Config.boKilledLostExp);
            M2Share.g_Config.nKillHumanWinExp = GetConfig<int>("Setup", "KillHumanWinExpPoint", M2Share.g_Config.nKillHumanWinExp);
            M2Share.g_Config.nKillHumanLostExp = GetConfig<int>("Setup", "KillHumanLostExpPoint", M2Share.g_Config.nKillHumanLostExp);
            M2Share.g_Config.nMonsterPowerRate = GetConfig<ushort>("Setup", "MonsterPowerRate", M2Share.g_Config.nMonsterPowerRate);
            M2Share.g_Config.nItemsPowerRate = GetConfig<int>("Setup", "ItemsPowerRate", M2Share.g_Config.nItemsPowerRate);
            M2Share.g_Config.nItemsACPowerRate = GetConfig<ushort>("Setup", "ItemsACPowerRate", M2Share.g_Config.nItemsACPowerRate);
            M2Share.g_Config.boSendOnlineCount = GetConfig<bool>("Setup", "SendOnlineCount", M2Share.g_Config.boSendOnlineCount);
            M2Share.g_Config.nSendOnlineCountRate = GetConfig<byte>("Setup", "SendOnlineCountRate", M2Share.g_Config.nSendOnlineCountRate);
            M2Share.g_Config.dwSendOnlineTime = GetConfig<uint>("Setup", "SendOnlineTime", M2Share.g_Config.dwSendOnlineTime);
            M2Share.g_Config.dwSaveHumanRcdTime = GetConfig<uint>("Setup", "SaveHumanRcdTime", M2Share.g_Config.dwSaveHumanRcdTime);
            M2Share.g_Config.dwMakeGhostTime = GetConfig<uint>("Setup", "MakeGhostTime", M2Share.g_Config.dwMakeGhostTime); // 尸体清理时间
            M2Share.g_Config.dwMakeGhostPlayMosterTime = GetConfig<uint>("Setup", "MakeGhostPlayMosterTime", M2Share.g_Config.dwMakeGhostPlayMosterTime); // 人形怪尸体清理时间 20080418
            M2Share.g_Config.dwClearDropOnFloorItemTime = GetConfig<uint>("Setup", "ClearDropOnFloorItemTime", M2Share.g_Config.dwClearDropOnFloorItemTime);
            M2Share.g_Config.dwFloorItemCanPickUpTime = GetConfig<uint>("Setup", "FloorItemCanPickUpTime", M2Share.g_Config.dwFloorItemCanPickUpTime);
            M2Share.g_Config.boPasswordLockSystem = GetConfig<bool>("Setup", "PasswordLockSystem", M2Share.g_Config.boPasswordLockSystem);
            M2Share.g_Config.boLockDealAction = GetConfig<bool>("Setup", "PasswordLockDealAction", M2Share.g_Config.boLockDealAction);
            M2Share.g_Config.boLockDropAction = GetConfig<bool>("Setup", "PasswordLockDropAction", M2Share.g_Config.boLockDropAction);
            M2Share.g_Config.boLockGetBackItemAction = GetConfig<bool>("Setup", "PasswordLockGetBackItemAction", M2Share.g_Config.boLockGetBackItemAction);
            M2Share.g_Config.boLockHumanLogin = GetConfig<bool>("Setup", "PasswordLockHumanLogin", M2Share.g_Config.boLockHumanLogin);
            M2Share.g_Config.boLockWalkAction = GetConfig<bool>("Setup", "PasswordLockWalkAction", M2Share.g_Config.boLockWalkAction);
            M2Share.g_Config.boLockRunAction = GetConfig<bool>("Setup", "PasswordLockRunAction", M2Share.g_Config.boLockRunAction);
            M2Share.g_Config.boLockHitAction = GetConfig<bool>("Setup", "PasswordLockHitAction", M2Share.g_Config.boLockHitAction);
            M2Share.g_Config.boLockSpellAction = GetConfig<bool>("Setup", "PasswordLockSpellAction", M2Share.g_Config.boLockSpellAction);
            M2Share.g_Config.boLockCallHeroAction = GetConfig<bool>("Setup", "PasswordLockCallHeroAction", M2Share.g_Config.boLockCallHeroAction);// 是否锁定召唤英雄操作
            M2Share.g_Config.boLockSendMsgAction = GetConfig<bool>("Setup", "PasswordLockSendMsgAction", M2Share.g_Config.boLockSendMsgAction);
            M2Share.g_Config.boLockUserItemAction = GetConfig<bool>("Setup", "PasswordLockUserItemAction", M2Share.g_Config.boLockUserItemAction);
            M2Share.g_Config.boLockInObModeAction = GetConfig<bool>("Setup", "PasswordLockInObModeAction", M2Share.g_Config.boLockInObModeAction);
            M2Share.g_Config.boPasswordErrorKick = GetConfig<bool>("Setup", "PasswordErrorKick", M2Share.g_Config.boPasswordErrorKick);
            M2Share.g_Config.nPasswordErrorCountLock = GetConfig<byte>("Setup", "PasswordErrorCountLock", M2Share.g_Config.nPasswordErrorCountLock);
            M2Share.g_Config.nSoftVersionDate = GetConfig<int>("Setup", "SoftVersionDate", M2Share.g_Config.nSoftVersionDate);
            M2Share.g_Config.boCanOldClientLogon = GetConfig<bool>("Setup", "CanOldClientLogon", M2Share.g_Config.boCanOldClientLogon);
            M2Share.g_Config.dwConsoleShowUserCountTime = GetConfig<uint>("Setup", "ConsoleShowUserCountTime", M2Share.g_Config.dwConsoleShowUserCountTime);
            M2Share.g_Config.dwShowLineNoticeTime = GetConfig<uint>("Setup", "ShowLineNoticeTime", M2Share.g_Config.dwShowLineNoticeTime);
            M2Share.g_Config.nLineNoticeColor = GetConfig<byte>("Setup", "LineNoticeColor", M2Share.g_Config.nLineNoticeColor);
            M2Share.g_Config.ClientConf.btItemSpeed = GetConfig<byte>("Setup", "ItemSpeedTime", M2Share.g_Config.ClientConf.btItemSpeed);
            M2Share.g_Config.nMaxHitMsgCount = GetConfig<byte>("Setup", "MaxHitMsgCount", M2Share.g_Config.nMaxHitMsgCount);
            M2Share.g_Config.nMaxSpellMsgCount = GetConfig<byte>("Setup", "MaxSpellMsgCount", M2Share.g_Config.nMaxSpellMsgCount);
            M2Share.g_Config.nMaxRunMsgCount = GetConfig<byte>("Setup", "MaxRunMsgCount", M2Share.g_Config.nMaxRunMsgCount);
            M2Share.g_Config.nMaxWalkMsgCount = GetConfig<byte>("Setup", "MaxWalkMsgCount", M2Share.g_Config.nMaxWalkMsgCount);
            M2Share.g_Config.nMaxTurnMsgCount = GetConfig<byte>("Setup", "MaxTurnMsgCount", M2Share.g_Config.nMaxTurnMsgCount);
            M2Share.g_Config.nMaxSitDonwMsgCount = GetConfig<byte>("Setup", "MaxSitDonwMsgCount", M2Share.g_Config.nMaxSitDonwMsgCount);
            M2Share.g_Config.nMaxDigUpMsgCount = GetConfig<byte>("Setup", "MaxDigUpMsgCount", M2Share.g_Config.nMaxDigUpMsgCount);
            M2Share.g_Config.boSpellSendUpdateMsg = GetConfig<bool>("Setup", "SpellSendUpdateMsg", M2Share.g_Config.boSpellSendUpdateMsg);
            M2Share.g_Config.boActionSendActionMsg = GetConfig<bool>("Setup", "ActionSendActionMsg", M2Share.g_Config.boActionSendActionMsg);
            M2Share.g_Config.nOverSpeedKickCount = GetConfig<byte>("Setup", "OverSpeedKickCount", M2Share.g_Config.nOverSpeedKickCount);
            M2Share.g_Config.dwDropOverSpeed = GetConfig<uint>("Setup", "DropOverSpeed", M2Share.g_Config.dwDropOverSpeed);
            M2Share.g_Config.boKickOverSpeed = GetConfig<bool>("Setup", "KickOverSpeed", M2Share.g_Config.boKickOverSpeed);
            M2Share.g_Config.btSpeedControlMode = GetConfig<byte>("Setup", "SpeedControlMode", M2Share.g_Config.btSpeedControlMode);
            M2Share.g_Config.dwHitIntervalTime = GetConfig<uint>("Setup", "HitIntervalTime", M2Share.g_Config.dwHitIntervalTime);
            M2Share.g_Config.dwMagicHitIntervalTime = GetConfig<uint>("Setup", "MagicHitIntervalTime", M2Share.g_Config.dwMagicHitIntervalTime);
            M2Share.g_Config.dwRunIntervalTime = GetConfig<uint>("Setup", "RunIntervalTime", M2Share.g_Config.dwRunIntervalTime);
            M2Share.g_Config.dwWalkIntervalTime = GetConfig<uint>("Setup", "WalkIntervalTime", M2Share.g_Config.dwWalkIntervalTime);
            M2Share.g_Config.dwTurnIntervalTime = GetConfig<uint>("Setup", "TurnIntervalTime", M2Share.g_Config.dwTurnIntervalTime);
            M2Share.g_Config.boControlActionInterval = GetConfig<bool>("Setup", "ControlActionInterval", M2Share.g_Config.boControlActionInterval);
            M2Share.g_Config.boControlWalkHit = GetConfig<bool>("Setup", "ControlWalkHit", M2Share.g_Config.boControlWalkHit);
            M2Share.g_Config.boControlRunLongHit = GetConfig<bool>("Setup", "ControlRunLongHit", M2Share.g_Config.boControlRunLongHit);
            M2Share.g_Config.boControlRunHit = GetConfig<bool>("Setup", "ControlRunHit", M2Share.g_Config.boControlRunHit);
            M2Share.g_Config.boControlRunMagic = GetConfig<bool>("Setup", "ControlRunMagic", M2Share.g_Config.boControlRunMagic);
            M2Share.g_Config.dwActionIntervalTime = GetConfig<uint>("Setup", "ActionIntervalTime", M2Share.g_Config.dwActionIntervalTime);
            M2Share.g_Config.dwRunLongHitIntervalTime = GetConfig<uint>("Setup", "RunLongHitIntervalTime", M2Share.g_Config.dwRunLongHitIntervalTime);
            M2Share.g_Config.dwRunHitIntervalTime = GetConfig<uint>("Setup", "RunHitIntervalTime", M2Share.g_Config.dwRunHitIntervalTime);
            M2Share.g_Config.dwWalkHitIntervalTime = GetConfig<uint>("Setup", "WalkHitIntervalTime", M2Share.g_Config.dwWalkHitIntervalTime);
            M2Share.g_Config.dwRunMagicIntervalTime = GetConfig<uint>("Setup", "RunMagicIntervalTime", M2Share.g_Config.dwRunMagicIntervalTime);
            M2Share.g_Config.boDisableStruck = GetConfig<bool>("Setup", "DisableStruck", M2Share.g_Config.boDisableStruck);
            M2Share.g_Config.boDisableSelfStruck = GetConfig<bool>("Setup", "DisableSelfStruck", M2Share.g_Config.boDisableSelfStruck);
            M2Share.g_Config.dwStruckTime = GetConfig<uint>("Setup", "StruckTime", M2Share.g_Config.dwStruckTime);
            M2Share.g_Config.boAddUserItemNewValue = GetConfig<bool>("Setup", "AddUserItemNewValue", M2Share.g_Config.boAddUserItemNewValue);
            M2Share.g_Config.boTestSpeedMode = GetConfig<bool>("Setup", "TestSpeedMode", M2Share.g_Config.boTestSpeedMode);
            M2Share.g_Config.nWeaponMakeUnLuckRate = GetConfig<ushort>("Setup", "WeaponMakeUnLuckRate", M2Share.g_Config.nWeaponMakeUnLuckRate);
            M2Share.g_Config.nWeaponMakeLuckPoint1 = GetConfig<ushort>("Setup", "WeaponMakeLuckPoint1", M2Share.g_Config.nWeaponMakeLuckPoint1);
            M2Share.g_Config.nWeaponMakeLuckPoint2 = GetConfig<ushort>("Setup", "WeaponMakeLuckPoint2", M2Share.g_Config.nWeaponMakeLuckPoint2);
            M2Share.g_Config.nWeaponMakeLuckPoint3 = GetConfig<ushort>("Setup", "WeaponMakeLuckPoint3", M2Share.g_Config.nWeaponMakeLuckPoint3);
            M2Share.g_Config.nWeaponMakeLuckPoint2Rate = GetConfig<ushort>("Setup", "WeaponMakeLuckPoint2Rate", M2Share.g_Config.nWeaponMakeLuckPoint2Rate);
            M2Share.g_Config.nWeaponMakeLuckPoint3Rate = GetConfig<ushort>("Setup", "WeaponMakeLuckPoint3Rate", M2Share.g_Config.nWeaponMakeLuckPoint3Rate);
            M2Share.g_Config.boCheckUserItemPlace = GetConfig<bool>("Setup", "CheckUserItemPlace", M2Share.g_Config.boCheckUserItemPlace);
            M2Share.g_Config.nLevelValueOfTaosHP = GetConfig<ushort>("Setup", "LevelValueOfTaosHP", M2Share.g_Config.nLevelValueOfTaosHP);
            M2Share.g_Config.nLevelValueOfTaosHPRate = GetConfig<double>("Setup", "LevelValueOfTaosHPRate", M2Share.g_Config.nLevelValueOfTaosHPRate);
            M2Share.g_Config.nLevelValueOfTaosMP = GetConfig<ushort>("Setup", "LevelValueOfTaosMP", M2Share.g_Config.nLevelValueOfTaosMP);
            M2Share.g_Config.nLevelValueOfWizardHP = GetConfig<ushort>("Setup", "LevelValueOfWizardHP", M2Share.g_Config.nLevelValueOfWizardHP);
            M2Share.g_Config.nLevelValueOfWizardHPRate = GetConfig<double>("Setup", "LevelValueOfWizardHPRate", M2Share.g_Config.nLevelValueOfWizardHPRate);
            M2Share.g_Config.nLevelValueOfWarrHP = GetConfig<ushort>("Setup", "LevelValueOfWarrHP", M2Share.g_Config.nLevelValueOfWarrHP);
            M2Share.g_Config.nLevelValueOfWarrHPRate = GetConfig<double>("Setup", "LevelValueOfWarrHPRate", M2Share.g_Config.nLevelValueOfWarrHPRate);
            M2Share.g_Config.nProcessMonsterInterval = GetConfig<sbyte>("Setup", "ProcessMonsterInterval", M2Share.g_Config.nProcessMonsterInterval);
            M2Share.g_Config.nStartCastleWarDays = GetConfig<byte>("Setup", "StartCastleWarDays", M2Share.g_Config.nStartCastleWarDays);
            M2Share.g_Config.nStartCastlewarTime = GetConfig<byte>("Setup", "StartCastlewarTime", M2Share.g_Config.nStartCastlewarTime);
            M2Share.g_Config.dwShowCastleWarEndMsgTime = GetConfig<uint>("Setup", "ShowCastleWarEndMsgTime", M2Share.g_Config.dwShowCastleWarEndMsgTime);
            M2Share.g_Config.dwCastleWarTime = GetConfig<uint>("Setup", "CastleWarTime", M2Share.g_Config.dwCastleWarTime);
            M2Share.g_Config.dwGetCastleTime = GetConfig<uint>("Setup", "GetCastleTime", M2Share.g_Config.dwGetCastleTime);
            M2Share.g_Config.dwGuildWarTime = GetConfig<uint>("Setup", "GuildWarTime", M2Share.g_Config.dwGuildWarTime);
            M2Share.g_Config.nWinLotteryCount = GetConfig<int>("Setup", "WinLotteryCount", M2Share.g_Config.nWinLotteryCount);
            M2Share.g_Config.nNoWinLotteryCount = GetConfig<int>("Setup", "NoWinLotteryCount", M2Share.g_Config.nNoWinLotteryCount);
            M2Share.g_Config.nWinLotteryLevel1 = GetConfig<int>("Setup", "WinLotteryLevel1",M2Share.g_Config.nWinLotteryLevel1);
            M2Share.g_Config.nWinLotteryLevel2 = GetConfig<int>("Setup", "WinLotteryLevel2",M2Share.g_Config.nWinLotteryLevel2);
            M2Share.g_Config.nWinLotteryLevel3 = GetConfig<int>("Setup", "WinLotteryLevel3",M2Share.g_Config.nWinLotteryLevel3);
            M2Share.g_Config.nWinLotteryLevel4 = GetConfig<int>("Setup", "WinLotteryLevel4",M2Share.g_Config.nWinLotteryLevel4);
            M2Share.g_Config.nWinLotteryLevel5 = GetConfig<int>("Setup", "WinLotteryLevel5",M2Share.g_Config.nWinLotteryLevel5);
            M2Share.g_Config.nWinLotteryLevel6 = GetConfig<int>("Setup", "WinLotteryLevel6", M2Share.g_Config.nWinLotteryLevel6);
            M2Share.g_Config.nDecUserGameGold = GetConfig<ushort>("Setup", "DecUserGameGold", M2Share.g_Config.nDecUserGameGold); // 每次扣多少元宝(元宝寄售)
            M2Share.g_Config.nMakeWineTime = GetConfig<int>("Setup", "MakeWineTime", M2Share.g_Config.nMakeWineTime);// 酿普通酒等待时间
            M2Share.g_Config.nMakeWineTime1 = GetConfig<int>("Setup", "MakeWineTime1", M2Share.g_Config.nMakeWineTime1);// 酿药酒等待时间
            M2Share.g_Config.nMakeWineRate = GetConfig<byte>("Setup", "MakeWineRate", M2Share.g_Config.nMakeWineRate);// 酿酒获得酒曲机率 20080621
            M2Share.g_Config.nIncAlcoholTick = GetConfig<int>("Setup", "IncAlcoholTick", M2Share.g_Config.nIncAlcoholTick);// 增加酒量进度的间隔时间 20080623
            M2Share.g_Config.nDesDrinkTick = GetConfig<int>("Setup", "DesDrinkTick", M2Share.g_Config.nDesDrinkTick);// 减少醉酒度的间隔时间 20080623
            M2Share.g_Config.nMaxAlcoholValue = GetConfig<ushort>("Setup", "MaxAlcoholValue", M2Share.g_Config.nMaxAlcoholValue); // 酒量上限初始值 20080623
            M2Share.g_Config.nIncAlcoholValue = GetConfig<ushort>("Setup", "IncAlcoholValue", M2Share.g_Config.nIncAlcoholValue);// 升级后增加酒量上限值 20080623
            M2Share.g_Config.nDesMedicineValue = GetConfig<ushort>("Setup", "DesMedicineValue", M2Share.g_Config.nDesMedicineValue);// 长时间不使用酒,减药力值 20080623
            M2Share.g_Config.nDesMedicineTick = GetConfig<ushort>("Setup", "DesMedicineTick", M2Share.g_Config.nDesMedicineTick);// 减药力值时间间隔 20080624
            M2Share.g_Config.nInFountainTime = GetConfig<ushort>("Setup", "InFountainTime", M2Share.g_Config.nInFountainTime); // 站在泉眼上的累积时间(秒) 20080624
            M2Share.g_Config.nMinGuildFountain = GetConfig<ushort>("Setup", "MinGuildFountain", M2Share.g_Config.nMinGuildFountain);// 行会酒泉蓄量少于时,不能领取 20080627
            M2Share.g_Config.nDecGuildFountain = GetConfig<ushort>("Setup", "DecGuildFountain", M2Share.g_Config.nDecGuildFountain);// 行会成员领取酒泉,蓄量减少 20080627
            M2Share.g_Config.nHeroCrystalExpRate = GetConfig<byte>("Setup", "HeroCrystalExpRate", M2Share.g_Config.nHeroCrystalExpRate);// 天地结晶英雄分配比例 20090202
            M2Share.g_Config.boPullPlayObject = GetConfig<bool>("Setup", "PullPlayObject", M2Share.g_Config.boPullPlayObject);
            M2Share.g_Config.boGroupMbAttackPlayObject = GetConfig<bool>("Setup", "GroupMbAttackPlayObject", M2Share.g_Config.boGroupMbAttackPlayObject);
            M2Share.g_Config.boPlayObjectReduceMP = GetConfig<bool>("Setup", "DamageMP", M2Share.g_Config.boPlayObjectReduceMP);
            M2Share.g_Config.boGroupMbAttackSlave = GetConfig<bool>("Setup", "GroupMbAttackSlave", M2Share.g_Config.boGroupMbAttackSlave);
            M2Share.g_Config.nBigStorageLimitCount = GetConfig<ushort>("Setup", "BigStorageLimitCount", M2Share.g_Config.nBigStorageLimitCount);
            M2Share.g_Config.boDropGoldToPlayBag = GetConfig<bool>("Setup", "DropGoldToPlayBag", M2Share.g_Config.boDropGoldToPlayBag);
            M2Share.g_Config.boChangeUseItemNameByPlayName = GetConfig<bool>("Setup", "ChangeUseItemNameByPlayName", M2Share.g_Config.boChangeUseItemNameByPlayName);
            M2Share.g_Config.sChangeUseItemName = GetConfig<string>("Setup", "ChangeUseItemName", M2Share.g_Config.sChangeUseItemName);
            M2Share.g_Config.nKill43UseTime = GetConfig<byte>("Setup", "Magic43UseTime", M2Share.g_Config.nKill43UseTime); // 开天斩使用间隔
            M2Share.g_Config.nDedingUseTime = GetConfig<byte>("Setup", "MagicDedingUseTime", M2Share.g_Config.nDedingUseTime);
            M2Share.g_Config.nAbilityUpTick = GetConfig<byte>("Setup", "AbilityUpTick", M2Share.g_Config.nAbilityUpTick); // 无极真气使用间隔 20080603
            M2Share.g_Config.boAbilityUpFixMode = GetConfig<bool>("Setup", "AbilityUpFixMode", M2Share.g_Config.boAbilityUpFixMode); // 无极真气使用时长模式
            M2Share.g_Config.nAbilityUpFixUseTime = GetConfig<byte>("Setup", "AbilityUpFixUseTime", M2Share.g_Config.nAbilityUpFixUseTime);// 无极真气使用固定时长 20081109
            M2Share.g_Config.nAbilityUpUseTime = GetConfig<byte>("Setup", "AbilityUpUseTime", M2Share.g_Config.nAbilityUpUseTime);// 无极真气使用时长 20080603
            M2Share.g_Config.nMinDrinkValue67 = GetConfig<byte>("Setup", "MinDrinkValue67", M2Share.g_Config.nMinDrinkValue67);// 先天元力失效酒量下限比例 20080626
            M2Share.g_Config.nMinDrinkValue68 = GetConfig<byte>("Setup", "MinDrinkValue68", M2Share.g_Config.nMinDrinkValue68);// 酒气护体失效酒量下限比例 20080626
            M2Share.g_Config.nHPUpTick = GetConfig<byte>("Setup", "HPUpTick", M2Share.g_Config.nHPUpTick); // 酒气护体使用间隔 20080625
            M2Share.g_Config.nHPUpUseTime = GetConfig<byte>("Setup", "HPUpUseTime", M2Share.g_Config.nHPUpUseTime);// 酒气护体增加使用时长 20080625
            M2Share.g_Config.boDedingAllowPK = GetConfig<bool>("Setup", "DedingAllowPK", M2Share.g_Config.boDedingAllowPK);// 分身术设置
            M2Share.g_Config.nMakeSelfTick = GetConfig<int>("Setup", "MakeSelfTick", M2Share.g_Config.nMakeSelfTick);// 分身使用时长 20080404
            M2Share.g_Config.nCopyHumanTick = GetConfig<int>("Setup", "CopyHumanTick", M2Share.g_Config.nCopyHumanTick);// 召唤分身的间隔 20080204
            M2Share.g_Config.nCopyHumanBagCount = GetConfig<int>("Setup", "CopyHumanBagCount", M2Share.g_Config.nCopyHumanBagCount);
            M2Share.g_Config.nCopyHumNameColor = GetConfig<byte>("Setup", "CopyHumNameColor", M2Share.g_Config.nCopyHumNameColor); // 分身名字颜色 20080404
            M2Share.g_Config.nAllowCopyHumanCount = GetConfig<int>("Setup", "AllowCopyHumanCount", M2Share.g_Config.nAllowCopyHumanCount);
            M2Share.g_Config.boAddMasterName = GetConfig<bool>("Setup", "AddMasterName", M2Share.g_Config.boAddMasterName);
            M2Share.g_Config.sCopyHumName = GetConfig<string>("Setup", "CopyHumName", M2Share.g_Config.sCopyHumName);
            M2Share.g_Config.nCopyHumAddHPRate = GetConfig<byte>("Setup", "CopyHumAddHPRate", M2Share.g_Config.nCopyHumAddHPRate);
            M2Share.g_Config.nCopyHumAddMPRate = GetConfig<byte>("Setup", "CopyHumAddMPRate", M2Share.g_Config.nCopyHumAddMPRate);
            M2Share.g_Config.sCopyHumBagItems1 = GetConfig<string>("Setup", "CopyHumBagItems1", M2Share.g_Config.sCopyHumBagItems1);
            M2Share.g_Config.sCopyHumBagItems2 = GetConfig<string>("Setup", "CopyHumBagItems2", M2Share.g_Config.sCopyHumBagItems2);
            M2Share.g_Config.sCopyHumBagItems3 = GetConfig<string>("Setup", "CopyHumBagItems3", M2Share.g_Config.sCopyHumBagItems3);
            M2Share.g_Config.boAllowGuardAttack = GetConfig<bool>("Setup", "AllowGuardAttack", M2Share.g_Config.boAllowGuardAttack);
            M2Share.g_Config.dwWarrorAttackTime = GetConfig<uint>("Setup", "WarrorAttackTime", M2Share.g_Config.dwWarrorAttackTime);
            M2Share.g_Config.dwWizardAttackTime = GetConfig<uint>("Setup", "WizardAttackTime", M2Share.g_Config.dwWizardAttackTime);
            M2Share.g_Config.dwTaoistAttackTime = GetConfig<uint>("Setup", "TaoistAttackTime", M2Share.g_Config.dwTaoistAttackTime);
            M2Share.g_Config.boAllowReCallMobOtherHum = GetConfig<bool>("Setup", "AllowReCallMobOtherHum", M2Share.g_Config.boAllowReCallMobOtherHum);
            M2Share.g_Config.boNeedLevelHighTarget = GetConfig<bool>("Setup", "NeedLevelHighTarget", M2Share.g_Config.boNeedLevelHighTarget);
            M2Share.g_Config.dwGetDBSockMsgTime = GetConfig<uint>("Setup", "GetDBSockMsgTime", M2Share.g_Config.dwGetDBSockMsgTime);
            M2Share.g_Config.boPullCrossInSafeZone = GetConfig<bool>("Setup", "PullCrossInSafeZone", M2Share.g_Config.boPullCrossInSafeZone);
            M2Share.g_Config.boStartMapEvent = GetConfig<bool>("Setup", "StartMapEvent", M2Share.g_Config.boStartMapEvent);
            M2Share.g_Config.nIsUseZhuLi = GetConfig<sbyte>("Setup", "IsUseZhuLi", M2Share.g_Config.nIsUseZhuLi);// 斗笠可带选项 20080417
            M2Share.g_Config.boUnKnowHum = GetConfig<bool>("Setup", "UnKnowHum", M2Share.g_Config.boUnKnowHum);// 带上斗笠是否显示神秘人 20080424

            M2Share.g_Config.nFireDelayTimeRate = GetConfig<ushort>("Setup", "FireDelayTimeRate", M2Share.g_Config.nFireDelayTimeRate);
            M2Share.g_Config.nFirePowerRate = GetConfig<ushort>("Setup", "FirePowerRate", M2Share.g_Config.nFirePowerRate);
            M2Share.g_Config.boChangeMapFireExtinguish = GetConfig<bool>("Setup", "ChangeMapFireExtinguish", M2Share.g_Config.boChangeMapFireExtinguish);
            M2Share.g_Config.nDidingPowerRate = GetConfig<ushort>("Setup", "DidingPowerRate", M2Share.g_Config.nDidingPowerRate);
            M2Share.g_Config.dwMagChangXYTick = GetConfig<uint>("Setup", "MagChangXYTick", M2Share.g_Config.dwMagChangXYTick); // 移行换位使用间隔 20080616
            M2Share.g_Config.nProtectionDefenceTime = GetConfig<uint>("Setup", "ProtectionDefenceTime", M2Share.g_Config.nProtectionDefenceTime);// 护体神盾相关设置参数 20080108
            M2Share.g_Config.dwProtectionTick = GetConfig<uint>("Setup", "ProtectionTick", M2Share.g_Config.dwProtectionTick);
            M2Share.g_Config.nProtectionRate = GetConfig<byte>("Setup", "ProtectionRate", M2Share.g_Config.nProtectionRate); // 护体神盾生效机率 20080929
            M2Share.g_Config.nProtectionOKRate = GetConfig<byte>("Setup", "ProtectionOKRate", M2Share.g_Config.nProtectionOKRate);
            M2Share.g_Config.nProtectionBadRate = GetConfig<byte>("Setup", "ProtectionBadRate", M2Share.g_Config.nProtectionBadRate);
            M2Share.g_Config.RushkungBadProtection = GetConfig<bool>("Setup", "RushkungBadProtection", M2Share.g_Config.RushkungBadProtection);
            M2Share.g_Config.ErgumBadProtection = GetConfig<bool>("Setup", "ErgumBadProtection", M2Share.g_Config.ErgumBadProtection);
            M2Share.g_Config.FirehitBadProtection = GetConfig<bool>("Setup", "FirehitBadProtection", M2Share.g_Config.FirehitBadProtection);
            M2Share.g_Config.TwnhitBadProtection = GetConfig<bool>("Setup", "TwnhitBadProtection", M2Share.g_Config.TwnhitBadProtection);// 显示护体神盾效果 20080328
            M2Share.g_Config.boShowProtectionEnv = GetConfig<bool>("Setup", "ShowProtectionEnv", M2Share.g_Config.boShowProtectionEnv); // 自动使用神盾 20080328
            M2Share.g_Config.boAutoProtection = GetConfig<bool>("Setup", "AutoProtection", M2Share.g_Config.boAutoProtection); // 智能锁定 20080418
            M2Share.g_Config.boAutoCanHit = GetConfig<bool>("Setup", "AutoCanHit", M2Share.g_Config.boAutoCanHit); // 宝宝是否飞到主人身边 20080713
            M2Share.g_Config.boSlaveMoveMaster = GetConfig<bool>("Setup", "SlaveMoveMaster", M2Share.g_Config.boSlaveMoveMaster); // 龙影剑法使用间隔 20080204
            M2Share.g_Config.nKill42UseTime = GetConfig<byte>("Setup", "Magic42UseTime", M2Share.g_Config.nKill42UseTime);// 龙影剑法威力 20080213
            M2Share.g_Config.nAttackRate_42 = GetConfig<ushort>("Setup", "AttackRate_42", M2Share.g_Config.nAttackRate_42); // 龙影剑法范围 20080218
            M2Share.g_Config.nMagicAttackRage_42 = GetConfig<byte>("Setup", "MagicAttackRage_42", M2Share.g_Config.nMagicAttackRage_42); // 英雄尸体清理时间 20080418
            M2Share.g_Config.nMakeGhostHeroTime = GetConfig<ushort>("HeroSetup", "MakeGhostHeroTime", M2Share.g_Config.nMakeGhostHeroTime); // 召唤英雄间隔 20071201 begin
            M2Share.g_Config.nRecallHeroTime = GetConfig<ushort>("HeroSetup", "RecallHeroTime", M2Share.g_Config.nRecallHeroTime); // 召唤英雄间隔 20071201 end// 英雄HP为人物的倍数 20081219
            M2Share.g_Config.nHeroHPRate = GetConfig<ushort>("HeroSetup", "HeroHPRate", M2Share.g_Config.nHeroHPRate); // 死亡减少忠诚度 20080110
            M2Share.g_Config.nDeathDecLoyal = GetConfig<ushort>("HeroSetup", "DeathDecLoyal", M2Share.g_Config.nDeathDecLoyal);// PK值减少忠诚度 20080214
            M2Share.g_Config.nPKDecLoyal = GetConfig<ushort>("HeroSetup", "PKDecLoyal", M2Share.g_Config.nPKDecLoyal);
            M2Share.g_Config.nGuildIncLoyal = GetConfig<ushort>("HeroSetup", "GuildIncLoyal", M2Share.g_Config.nGuildIncLoyal);// 行会战增加忠诚度 20080214
            M2Share.g_Config.nLevelOrderIncLoyal = GetConfig<ushort>("HeroSetup", "LevelOrderIncLoyal", M2Share.g_Config.nLevelOrderIncLoyal); // 人物等级排名上升增加忠诚度 20080214
            M2Share.g_Config.nLevelOrderDecLoyal = GetConfig<ushort>("HeroSetup", "LevelOrderDecLoyal", M2Share.g_Config.nLevelOrderDecLoyal);// 人物等级排名下降减少忠诚度 20080214
            M2Share.g_Config.nWinExp = GetConfig<int>("HeroSetup", "WinExp", M2Share.g_Config.nWinExp); // 获得经验->忠诚度 20080110
            M2Share.g_Config.nExpAddLoyal = GetConfig<ushort>("HeroSetup", "ExpAddLoyal", M2Share.g_Config.nExpAddLoyal); // 经验加忠诚 20080110
            M2Share.g_Config.nGotoLV4 = GetConfig<ushort>("HeroSetup", "GotoLV4", M2Share.g_Config.nGotoLV4);// 四级触发 20080110
            M2Share.g_Config.nPowerLV4 = GetConfig<byte>("HeroSetup", "PowerLV4", M2Share.g_Config.nPowerLV4); // 四级技能杀伤力增加值 20080112
            M2Share.g_Config.dwHeroWalkIntervalTime = GetConfig<uint>("HeroSetup","HeroWalkIntervalTime", M2Share.g_Config.dwHeroWalkIntervalTime);
            M2Share.g_Config.dwHeroTurnIntervalTime = GetConfig<uint>("HeroSetup","HeroTurnIntervalTime", M2Share.g_Config.dwHeroTurnIntervalTime); // 英雄转向间隔 20080213
            M2Share.g_Config.dwHeroMagicHitIntervalTime = GetConfig<uint>("HeroSetup","HeroMagicHitIntervalTime", M2Share.g_Config.dwHeroMagicHitIntervalTime); // 英雄魔法间隔 20080524
            M2Share.g_Config.btHeroSkillMode = GetConfig<bool>("HeroSetup","HeroSkillMode", M2Share.g_Config.btHeroSkillMode); // 英雄施毒术使用模式 20080604
            M2Share.g_Config.btHeroSkillMode50 = GetConfig<bool>("HeroSetup","HeroSkillMode50", M2Share.g_Config.btHeroSkillMode50); // 英雄无极真气使用模式 20080827
            M2Share.g_Config.btHeroSkillMode46 = GetConfig<bool>("HeroSetup","HeroSkillMode46", M2Share.g_Config.btHeroSkillMode46);// 英雄分身术模式 20081029
            M2Share.g_Config.btHeroSkillMode43 = GetConfig<bool>("HeroSetup","HeroSkillMode43", M2Share.g_Config.btHeroSkillMode43);// 英雄开天斩重击模式 20081221
            M2Share.g_Config.btHeroSkillMode_63 = GetConfig<bool>("HeroSetup","HeroSkillMode_63", M2Share.g_Config.btHeroSkillMode_63);// 噬魂沼泽使用绿毒模式 20080911
            M2Share.g_Config.nHeroStartLevel = GetConfig<ushort>("HeroSetup", "StartLevel", M2Share.g_Config.nHeroStartLevel);// 卧龙英雄开始等级 20080514
            M2Share.g_Config.nDrinkHeroStartLevel = GetConfig<ushort>("HeroSetup", "DrinkHeroStartLevel", M2Share.g_Config.nDrinkHeroStartLevel);
            M2Share.g_Config.nHeroKillMonExpRate = GetConfig<byte>("HeroSetup", "KillMonExpRate", M2Share.g_Config.nHeroKillMonExpRate);// 20080803 非杀怪分配经验比例
            M2Share.g_Config.nHeroNoKillMonExpRate = GetConfig<byte>("HeroSetup", "NoKillMonExpRate", M2Share.g_Config.nHeroNoKillMonExpRate);
            for (var i = M2Share.g_Config.nHeroBagItemCount.GetLowerBound(0); i <= M2Share.g_Config.nHeroBagItemCount.GetUpperBound(0); i++)
            {
                M2Share.g_Config.nHeroBagItemCount[i] = GetConfig<ushort>("HeroSetup", "BagItemCount" + i, M2Share.g_Config.nHeroBagItemCount[i]);
            }
            M2Share.g_Config.dwHeroWarrorAttackTime = GetConfig<uint>("HeroSetup","WarrorAttackTime", M2Share.g_Config.dwHeroWarrorAttackTime);
            M2Share.g_Config.dwHeroWizardAttackTime = GetConfig<uint>("HeroSetup","WizardAttackTime", M2Share.g_Config.dwHeroWizardAttackTime);
            M2Share.g_Config.dwHeroTaoistAttackTime = GetConfig<uint>("HeroSetup","TaoistAttackTime", M2Share.g_Config.dwHeroTaoistAttackTime);
            M2Share.g_Config.boHeroKillByMonstDropUseItem = GetConfig<bool>("HeroSetup","KillByMonstDropUseItem", M2Share.g_Config.boHeroKillByMonstDropUseItem);
            M2Share.g_Config.boHeroKillByHumanDropUseItem = GetConfig<bool>("HeroSetup","KillByHumanDropUseItem", M2Share.g_Config.boHeroKillByHumanDropUseItem);
            M2Share.g_Config.boHeroDieScatterBag = GetConfig<bool>("HeroSetup","DieScatterBag", M2Share.g_Config.boHeroDieScatterBag);// 英雄无目标下自动开启护体神盾 20080715
            M2Share.g_Config.boHeroAutoProtectionDefence = GetConfig<bool>("HeroSetup","HeroAutoProtectionDefence", M2Share.g_Config.boHeroAutoProtectionDefence);// 英雄无目标下可召唤宝宝 20080615
            M2Share.g_Config.boHeroNoTargetCall = GetConfig<bool>("HeroSetup","HeroNoTargetCall", M2Share.g_Config.boHeroNoTargetCall);// 英雄死亡掉经验 20080605
            M2Share.g_Config.boHeroDieExp = GetConfig<bool>("HeroSetup","HeroDieExp", M2Share.g_Config.boHeroDieExp);
            M2Share.g_Config.nHeroDieExpRate = GetConfig<byte>("HeroSetup", "HeroDieExpRate", M2Share.g_Config.nHeroDieExpRate);// 英雄死亡掉经验比率 20080605
            M2Share.g_Config.boHeroDieRedScatterBagAll = GetConfig<bool>("HeroSetup","DieRedScatterBagAll", M2Share.g_Config.boHeroDieRedScatterBagAll);
            M2Share.g_Config.nHeroDieDropUseItemRate = GetConfig<ushort>("HeroSetup", "DieDropUseItemRate", M2Share.g_Config.nHeroDieDropUseItemRate);
            M2Share.g_Config.nHeroDieRedDropUseItemRate = GetConfig<byte>("HeroSetup", "DieRedDropUseItemRate", M2Share.g_Config.nHeroDieRedDropUseItemRate);
            M2Share.g_Config.nHeroDieScatterBagRate = GetConfig<ushort>("HeroSetup", "DieScatterBagRate", M2Share.g_Config.nHeroDieScatterBagRate);
            M2Share.g_Config.nHeroAddHPRate = GetConfig<byte>("HeroSetup", "HeroAddHPRate", M2Share.g_Config.nHeroAddHPRate);
            M2Share.g_Config.nHeroAddMPRate = GetConfig<byte>("HeroSetup", "HeroAddMPRate", M2Share.g_Config.nHeroAddMPRate);
            M2Share.g_Config.nHeroAddHPMPTick = GetConfig<uint>("HeroSetup","HeroAddHPMPTick", M2Share.g_Config.nHeroAddHPMPTick);  // 英雄吃普通药速度 20080601
            M2Share.g_Config.nHeroAddHPRate1 = GetConfig<byte>("HeroSetup", "HeroAddHPRate1", M2Share.g_Config.nHeroAddHPRate1);
            M2Share.g_Config.nHeroAddMPRate1 = GetConfig<byte>("HeroSetup", "HeroAddMPRate1", M2Share.g_Config.nHeroAddMPRate1);
            M2Share.g_Config.nHeroAddHPMPTick1 = GetConfig<uint>("HeroSetup","HeroAddHPMPTick1", M2Share.g_Config.nHeroAddHPMPTick1);  // 吃特殊药速度 20080910
            M2Share.g_Config.nMaxFirDragonPoint = GetConfig<ushort>("HeroSetup", "MaxFirDragonPoint", M2Share.g_Config.nMaxFirDragonPoint);
            M2Share.g_Config.nAddFirDragonPoint = GetConfig<ushort>("HeroSetup", "AddFirDragonPoint", M2Share.g_Config.nAddFirDragonPoint);
            M2Share.g_Config.nDecFirDragonPoint = GetConfig<ushort>("HeroSetup", "DecFirDragonPoint", M2Share.g_Config.nDecFirDragonPoint);
            M2Share.g_Config.nIncDragonPointTick = GetConfig<uint>("HeroSetup","IncDragonPointTick", M2Share.g_Config.nIncDragonPointTick); // 加怒气时间间隔 20080606
            M2Share.g_Config.nHeroSkill46MaxHP_0 = GetConfig<byte>("HeroSetup", "HeroSkill46MaxHP_0", M2Share.g_Config.nHeroSkill46MaxHP_0);// 0级 英雄召唤分身HP的比率 20080907
            M2Share.g_Config.nHeroSkill46MaxHP_1 = GetConfig<byte>("HeroSetup", "HeroSkill46MaxHP_1", M2Share.g_Config.nHeroSkill46MaxHP_1);// 1级 英雄召唤分身HP的比率 20081217
            M2Share.g_Config.nHeroSkill46MaxHP_2 = GetConfig<byte>("HeroSetup", "HeroSkill46MaxHP_2", M2Share.g_Config.nHeroSkill46MaxHP_2); // 2级 英雄召唤分身HP的比率 20081217
            M2Share.g_Config.nHeroSkill46MaxHP_3 = GetConfig<byte>("HeroSetup", "HeroSkill46MaxHP_3", M2Share.g_Config.nHeroSkill46MaxHP_3);// 3级 英雄召唤分身HP的比率 20081217
            M2Share.g_Config.nHeroMakeSelfTick = GetConfig<ushort>("HeroSetup", "HeroMakeSelfTick", M2Share.g_Config.nHeroMakeSelfTick); // 英雄分身延长使用时间 20081217
            M2Share.g_Config.nDecDragonHitPoint = GetConfig<byte>("HeroSetup", "DecDragonHitPoint", M2Share.g_Config.nDecDragonHitPoint);// 饮酒减少合击伤害 20080626
            M2Share.g_Config.nDecDragonRate = GetConfig<byte>("HeroSetup", "DecDragonRate", M2Share.g_Config.nDecDragonRate);// 合击对人物的伤害比例 20080803
            M2Share.g_Config.nHeroNameColor = GetConfig<byte>("HeroSetup", "nHeroNameColor", M2Share.g_Config.nHeroNameColor);// 英雄名字颜色 20080315
            M2Share.g_Config.sHeroName = GetConfig<string>("HeroSetup","sHeroName", M2Share.g_Config.sHeroName);//英雄名
            M2Share.g_Config.sHeroNameSuffix = GetConfig<string>("HeroSetup","sHeroNameSuffix", M2Share.g_Config.sHeroNameSuffix);  // 英雄名后缀  20080315
            M2Share.g_Config.boNameSuffix = GetConfig<bool>("HeroSetup","boNameSuffix", M2Share.g_Config.boNameSuffix);   // 是否显示后缀  20080315
            M2Share.g_Config.boNoSafeProtect = GetConfig<bool>("HeroSetup","boNoSafeProtect", M2Share.g_Config.boNoSafeProtect); // 禁止安全区守护 20080603
            M2Share.g_Config.boHeroAttackTarget = GetConfig<bool>("HeroSetup","boHeroAttackTarget", M2Share.g_Config.boHeroAttackTarget);  // 道法22前是否物理攻击 20081218
            M2Share.g_Config.boHeroAttackTao = GetConfig<bool>("HeroSetup","boHeroAttackTao", M2Share.g_Config.boHeroAttackTao);// 道22后是否物理攻击 20090108
            M2Share.g_Config.boRestNoFollow = GetConfig<bool>("HeroSetup","boRestNoFollow", M2Share.g_Config.boRestNoFollow); // 英雄休息不跟随主人切换地图 20081209
            M2Share.g_Config.nHeroAttackRate_60 = GetConfig<ushort>("HeroSetup", "HeroAttackRate_60", M2Share.g_Config.nHeroAttackRate_60);// 破魂斩威力 20080131
            M2Share.g_Config.nHeroAttackRange_60 = GetConfig<byte>("HeroSetup", "HeroAttackRange_60", M2Share.g_Config.nHeroAttackRange_60);// 破魂斩 攻击范围 20080406
            M2Share.g_Config.nHeroAttackRate_61 = GetConfig<ushort>("HeroSetup", "HeroAttackRate_61", M2Share.g_Config.nHeroAttackRate_61);// 劈星斩威力 20080131
            M2Share.g_Config.nHeroAttackRate_62 = GetConfig<byte>("HeroSetup", "HeroAttackRate_62", M2Share.g_Config.nHeroAttackRate_62); // 雷霆一击威力 20080131
            M2Share.g_Config.nHeroAttackRate_63 = GetConfig<byte>("HeroSetup", "HeroAttackRate_63", M2Share.g_Config.nHeroAttackRate_63);  // 噬魂沼泽威力 20080131
            M2Share.g_Config.nHeroAttackRange_63 = GetConfig<byte>("HeroSetup", "HeroAttackRange_63", M2Share.g_Config.nHeroAttackRange_63); // 噬魂沼泽 攻击范围 20080131
            M2Share.g_Config.nHeroAttackRate_64 = GetConfig<byte>("HeroSetup", "HeroAttackRate_64", M2Share.g_Config.nHeroAttackRate_64);// 末日审判威力 20080131
            M2Share.g_Config.nHeroAttackRate_65 = GetConfig<byte>("HeroSetup", "HeroAttackRate_65", M2Share.g_Config.nHeroAttackRate_65);// 火龙气焰威力 20080131
            M2Share.g_Config.nHeroAttackRange_64 = GetConfig<byte>("HeroSetup", "HeroAttackRange_64", M2Share.g_Config.nHeroAttackRange_64);// 末日审判  攻击范围 20081216
            M2Share.g_Config.nHeroAttackRange_65 = GetConfig<byte>("HeroSetup", "HeroAttackRange_65", M2Share.g_Config.nHeroAttackRange_65);// 火龙气焰 攻击范围 20080131
            M2Share.g_Config.sHeroClothsMan = GetConfig<string>("HeroSetup","ClothsMan", M2Share.g_Config.sHeroClothsMan);
            M2Share.g_Config.sHeroClothsWoman = GetConfig<string>("HeroSetup","ClothsWoman", M2Share.g_Config.sHeroClothsWoman);
            M2Share.g_Config.sHeroWoodenSword = GetConfig<string>("HeroSetup","WoodenSword", M2Share.g_Config.sHeroWoodenSword);
            M2Share.g_Config.sHeroBasicDrug = GetConfig<string>("HeroSetup","BasicDrug", M2Share.g_Config.sHeroBasicDrug);

            M2Share.g_Config.PulsePointNGLevel0 = GetConfig<ushort>("Setup", "PulsePointNGLevel0", M2Share.g_Config.PulsePointNGLevel0);
            M2Share.g_Config.PulsePointNGLevel1 = GetConfig<ushort>("Setup", "PulsePointNGLevel1", M2Share.g_Config.PulsePointNGLevel1);
            M2Share.g_Config.PulsePointNGLevel2 = GetConfig<ushort>("Setup", "PulsePointNGLevel2", M2Share.g_Config.PulsePointNGLevel2);
            M2Share.g_Config.PulsePointNGLevel3 = GetConfig<ushort>("Setup", "PulsePointNGLevel3", M2Share.g_Config.PulsePointNGLevel3);
            M2Share.g_Config.PulsePointNGLevel4 = GetConfig<ushort>("Setup", "PulsePointNGLevel4", M2Share.g_Config.PulsePointNGLevel4);
            M2Share.g_Config.PulsePointNGLevel5 = GetConfig<ushort>("Setup", "PulsePointNGLevel5", M2Share.g_Config.PulsePointNGLevel5);
            M2Share.g_Config.PulsePointNGLevel6 = GetConfig<ushort>("Setup", "PulsePointNGLevel6", M2Share.g_Config.PulsePointNGLevel6);
            M2Share.g_Config.PulsePointNGLevel7 = GetConfig<ushort>("Setup", "PulsePointNGLevel7", M2Share.g_Config.PulsePointNGLevel7);
            M2Share.g_Config.PulsePointNGLevel8 = GetConfig<ushort>("Setup", "PulsePointNGLevel8", M2Share.g_Config.PulsePointNGLevel8);
            M2Share.g_Config.PulsePointNGLevel9 = GetConfig<ushort>("Setup", "PulsePointNGLevel9", M2Share.g_Config.PulsePointNGLevel9);
            M2Share.g_Config.PulsePointNGLevel10 = GetConfig<ushort>("Setup", "PulsePointNGLevel10", M2Share.g_Config.PulsePointNGLevel10);
            M2Share.g_Config.PulsePointNGLevel11 = GetConfig<ushort>("Setup", "PulsePointNGLevel11", M2Share.g_Config.PulsePointNGLevel11);
            M2Share.g_Config.PulsePointNGLevel12 = GetConfig<ushort>("Setup", "PulsePointNGLevel12", M2Share.g_Config.PulsePointNGLevel12);
            M2Share.g_Config.PulsePointNGLevel13 = GetConfig<ushort>("Setup", "PulsePointNGLevel13", M2Share.g_Config.PulsePointNGLevel13);
            M2Share.g_Config.PulsePointNGLevel14 = GetConfig<ushort>("Setup", "PulsePointNGLevel14", M2Share.g_Config.PulsePointNGLevel14);
            M2Share.g_Config.PulsePointNGLevel15 = GetConfig<ushort>("Setup", "PulsePointNGLevel15", M2Share.g_Config.PulsePointNGLevel15);
            M2Share.g_Config.PulsePointNGLevel16 = GetConfig<ushort>("Setup", "PulsePointNGLevel16", M2Share.g_Config.PulsePointNGLevel16);
            M2Share.g_Config.PulsePointNGLevel17 = GetConfig<ushort>("Setup", "PulsePointNGLevel17", M2Share.g_Config.PulsePointNGLevel17);
            M2Share.g_Config.PulsePointNGLevel18 = GetConfig<ushort>("Setup", "PulsePointNGLevel18", M2Share.g_Config.PulsePointNGLevel18);
            M2Share.g_Config.PulsePointNGLevel19 = GetConfig<ushort>("Setup", "PulsePointNGLevel19", M2Share.g_Config.PulsePointNGLevel19);
            M2Share.g_Config.BatterSkillFireRange_82 = GetConfig<ushort>("Setup", "BatterSkillFireRange_82", M2Share.g_Config.BatterSkillFireRange_82);
            M2Share.g_Config.BatterSkillFireRange_85 = GetConfig<ushort>("Setup", "BatterSkillFireRange_85", M2Share.g_Config.BatterSkillFireRange_85);
            M2Share.g_Config.BatterSkillFireRange_86 = GetConfig<ushort>("Setup", "BatterSkillFireRange_86", M2Share.g_Config.BatterSkillFireRange_86);
            M2Share.g_Config.BatterSkillFireRange_87 = GetConfig<ushort>("Setup", "BatterSkillFireRange_87", M2Share.g_Config.BatterSkillFireRange_87);
            M2Share.g_Config.BatterSkillPoinson_86 = GetConfig<ushort>("Setup", "BatterSkillPoinson_86", M2Share.g_Config.BatterSkillPoinson_86);
            M2Share.g_Config.BatterSkillPoinson_87 = GetConfig<ushort>("Setup", "BatterSkillPoinson_87", M2Share.g_Config.BatterSkillPoinson_87);
            M2Share.g_Config.StormsHitRate1 = GetConfig<int>("Setup", "StormsHitRate1", M2Share.g_Config.StormsHitRate1);
            M2Share.g_Config.StormsHitRate2 = GetConfig<int>("Setup", "StormsHitRate2", M2Share.g_Config.StormsHitRate2);
            M2Share.g_Config.StormsHitRate3 = GetConfig<int>("Setup", "StormsHitRate3", M2Share.g_Config.StormsHitRate3);
            M2Share.g_Config.StormsHitRate4 = GetConfig<int>("Setup", "StormsHitRate4", M2Share.g_Config.StormsHitRate4);
            M2Share.g_Config.StormsHitRate5 = GetConfig<int>("Setup", "StormsHitRate5", M2Share.g_Config.StormsHitRate5);
            M2Share.g_Config.StormsHitAppearRate0 = GetConfig<int>("Setup", "StormsHitAppearRate0", M2Share.g_Config.StormsHitAppearRate0);
            M2Share.g_Config.StormsHitAppearRate1 = GetConfig<int>("Setup", "StormsHitAppearRate1", M2Share.g_Config.StormsHitAppearRate1);
            M2Share.g_Config.StormsHitAppearRate2 = GetConfig<int>("Setup", "StormsHitAppearRate2", M2Share.g_Config.StormsHitAppearRate2);
            M2Share.g_Config.StormsHitAppearRate3 = GetConfig<int>("Setup", "StormsHitAppearRate3", M2Share.g_Config.StormsHitAppearRate3);
            M2Share.g_Config.StormsHitAppearRate4 = GetConfig<int>("Setup", "StormsHitAppearRate4", M2Share.g_Config.StormsHitAppearRate4);
            M2Share.g_Config.UseBatterTick = GetConfig<int>("Setup", "UseBatterTick", M2Share.g_Config.UseBatterTick);
            M2Share.g_Config.Magic69UseTime = GetConfig<int>("Setup", "Magic69UseTime", M2Share.g_Config.Magic69UseTime);
            // -------------------英雄其他设置 包括双英雄设置--------------//
            M2Share.g_Config.Strength1DecGold = GetConfig<int>("HeroSetup", "Strength1DecGold", M2Share.g_Config.Strength1DecGold);
            M2Share.g_Config.Strength1DecGameGird = GetConfig<int>("HeroSetup", "Strength1DecGameGird", M2Share.g_Config.Strength1DecGameGird);
            M2Share.g_Config.Strength1Exp = GetConfig<int>("HeroSetup", "Strength1Exp", M2Share.g_Config.Strength1Exp);
            M2Share.g_Config.Strength2DecGold = GetConfig<int>("HeroSetup", "Strength2DecGold", M2Share.g_Config.Strength2DecGold);
            M2Share.g_Config.Strength2DecGameGird = GetConfig<int>("HeroSetup", "Strength2DecGameGird", M2Share.g_Config.Strength2DecGameGird);
            M2Share.g_Config.Strength2Exp = GetConfig<int>("HeroSetup", "Strength2Exp", M2Share.g_Config.Strength2Exp);
            M2Share.g_Config.Strength3DecGold = GetConfig<int>("HeroSetup", "Strength3DecGold", M2Share.g_Config.Strength3DecGold);
            M2Share.g_Config.Strength3DecGameGird = GetConfig<int>("HeroSetup", "Strength3DecGameGird", M2Share.g_Config.Strength3DecGameGird);
            M2Share.g_Config.Strength3Exp = GetConfig<int>("HeroSetup", "Strength3Exp", M2Share.g_Config.Strength3Exp);
            M2Share.g_Config.RecallDeputyHeroTime = GetConfig<int>("HeroSetup", "RecallDeputyHeroTime", M2Share.g_Config.RecallDeputyHeroTime);// 召唤圣兽相关
            M2Share.g_Config.SacRed = GetConfig<string>("Setup", "Sacred", M2Share.g_Config.SacRed);
            M2Share.g_Config.SacredCount = GetConfig<byte>("Setup", "SacredCount", M2Share.g_Config.SacredCount);

            M2Share.g_Config.boSaveExpRate = GetConfig<bool>("Exp","SaveExpRate", M2Share.g_Config.boSaveExpRate); // 是否保存双倍经验时间 20080412
            M2Share.g_Config.nLimitExpLevel = GetConfig<ushort>("Exp", "LimitExpLevel", M2Share.g_Config.nLimitExpLevel);
            M2Share.g_Config.nLimitExpValue = GetConfig<int>("Exp", "LimitExpValue", M2Share.g_Config.nLimitExpValue);
            M2Share.g_Config.boHighLevelGroupFixExp = GetConfig<bool>("Exp", "HighLevelGroupFixExp", M2Share.g_Config.boHighLevelGroupFixExp);

            M2Share.g_Config.g_boGameGird = GetConfig<bool>("Shop", "ShopBuyGameGird", M2Share.g_Config.g_boGameGird);
            M2Share.g_Config.g_boGameGird = GetConfig<bool>("Shop", "ShopBuyGameGird", M2Share.g_Config.g_boGameGird);
            M2Share.g_Config.g_nGameGold = GetConfig<int>("Shop", "GameGold", M2Share.g_Config.g_nGameGold);
        }

        public T GetConfig<T>(string nodeName, string keyName, object defaultValue)
        {
            if (!_tableConfig.ContainsKey(nodeName))
            {
                return (T)Convert.ChangeType(defaultValue, typeof(T));
            }
            var yamlNode = _tableConfig.Get<Dictionary<string,object>>(nodeName);
            if (!yamlNode.TryGetValue(keyName,out object valuesData))
            {
                return (T)Convert.ChangeType(defaultValue, typeof(T));
            }
            return (T)Convert.ChangeType(valuesData, typeof(T));
        }
    }
}